Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.3k 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 Answer

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...