Vue组件中的jQuery插件:无法将值传递给prop

我在vue组件中添加了jquery redactor插件。 该插件工作正常但我需要访问html所以我可以在Vue中看到它。

我已经尝试了我能想到的一切,方法,计算属性,但我找不到办法。 它特别棘手,因为Redactor在dom中添加了新的html,我需要从添加的html中获取数据。

目前我收到这个错误, this.$emit is not a function 。 我需要将.redactor-editor的html值放入prop中,以便在vue数据中可用。 var textContent在控制台中正确打印出来但我无法在prop显示。 任何帮助是极大的赞赏。

零件

  

JS

 Vue.component('vueredactor', require('./components/redactor.vue')); var App = new Vue({ el: '#app', data: { redactorContent: null } }); 

HTML

 

这是我使用Imperavi的Redactor Editor 3工作的VueJS 2组件。 在同一视图中支持多编辑器,但编辑器需要唯一的名称/ ID。 不需要jQuery库。

RedactorEditor.vue

   

App.vue

 import Vue from 'vue' import RedactorEditor from './components/RedactorEditor.vue' // app const app = new Vue({ el: '#my-app', data: { editorButtons: ['undo', 'redo', 'bold', 'italic', 'lists', 'link'], editorPlugins: [], beyondgrammarSettings: {} editorHTMLContent: '', }, components: { RedactorEditor } } 

HTML用法

  

使用vee-validate的自定义Validator示例: https : //gist.github.com/matinfo/52214f7f34ce6b746b483f0f92e6b5e5

Interesting Posts