Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.4k views
in Technique[技术] by (71.8m points)

vue v-html 生产环境不生效,怎么解决?

问题描述

vue.js--

在开发环境中,v-html 解析富文本内容,正确且正常生效,但是在切换为生产环境时(vue-cli),v-html不生效了,富文本内容html标签被当做文本字符串渲染出来。并且打包上传到服务器,同样不生效,有谁遇到过么?怎么解决?

代码

<section class="score-main-context" v-html="activity.context"></section>


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

v-html没有区分环境渲染的功能,建议你看下是不是其他问题。比如代理线上环境,然后排查问题


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...