我在Redactor上使用v模型。当我这样做时,它返回“事件”而不是我正在寻找的实际数据。关于如何返回正确数据的任何想法?
HTML
<div id="question-create-form">
<textarea class="form-control question-create-editor" id="question_description" rows="3"></textarea>
</div>
JS
$('#question-create-form .question-create-editor').redactor({
imageUpload:'/urlGoesHereBro/',
plugins: ['video', 'imagemanager', 'counter', 'limiter'],
buttonsHide:['html', 'formatting', 'deleted', 'indent', 'outdent', 'alignment', 'horizontalrule']
});
$('#question-create-form .redactor-editor').attr('v-model', 'questionDescription');
答案 0 :(得分:3)
Redactor似乎是一个jQuery小部件,这意味着它可以通过操作DOM来工作。 Vue希望控制DOM,这意味着两者将相互踩在一起。脚趾除非您将(Redactor的)DOM操作限制在wrapper component的生命周期挂钩中。
要制作Redactor组件work with v-model
,需要:
value
道具input
事件
醇>