How to introduce vue2 ace into Vue cli- editor.js plug-in unit?
The project wants to introduce a relatively unpopular plug-in vue2 ace- editor.js This is how the official demo is introduced
var Vue = require('vue/dist/vue.common.js');
document.querySelector('body').append(document.createElement('div'))
new Vue({
template:'<editor v-model="content" lang="html" height="500" @init="initEditor"></editor>',
data:{
content:""
},
components:{
editor:require('vue2-ace-editor')
},
methods:{
initEditor:function (editor) {
require('brace/mode/html');
require('brace/theme/chrome');
}
}
}).$mount('div');
As far as I know, Vue cli does not support direct require at present. Should I common.js Introduce it? Beginners, are not familiar with node and webpack? Does anyone know how to do it?
Read more here: Source link