我在Vue.js中创建了答案和问题页面,答案被封装在另一个组件中。但是,当我尝试这样做时:
<template>
<div>
<answer-box
answerId="availability"
question="Do you stil make ABC?"
:answer="answer1" />
</div>
</template>
<script>
import AnswerBox from '@/components/FAQAnswer'
export default {
components: {
AnswerBox,
},
data() {
return {
answer1: 'Sorry, but <strong>no</strong> — we don\'t make
those anymore. However, you may head to our
<router-link to="/partners">partners</router-link>
to check if they still have them',
}
},
}
</script>
我尝试使用计算道具将"
替换为"
,
替换&#34;通过道具时使用"
并放置这些
道具到v-html指令。句子被渲染,但是
router-link呈现为常规字符串(无链接)
btw,我使用vue 2.5,vscode,eslint 4.10,节点8.9.3,webpack 3.8