我有一个自定义的所见即所得的文本编辑器,你可以在其中添加图像,所以输出是超级胖的:)问题是当我试图用之前生成的base64初始化我的组件时:
<text-editor name="content" v-model="{{ $page->content }}"></text-editor>给定的错误不明确:Error compiling template ... FULL TEMPLATE ... (found in <Root>)
我试着用html_entity_decode、htmlentities、htmlspecialchars来避开html,但效果不佳……
发布于 2019-02-19 23:46:09
v-model是一种语法糖,用于:
<text-editor name="content" :value="{{ $page->content }}" @input="{{ $page->content }} = $event.target.value"></text-editor> 如果您将{{ $page->content }}替换为HTML内容(如PHP所做的那样),您将看到它不起作用:
<text-editor name="content" :value="<div></div>" @input="<div></div> = $event.target.value"></text-editor>尝试将静态值(不带:)传递给编辑器,而不使用v-model
<text-editor name="content" value="{{ $page->content }}"></text-editor>https://stackoverflow.com/questions/54769538
复制相似问题