我在Vue中引入下载的ueditor插件,但是用浏览器访问的时候报一下错误,求大神指导下,刚接触,不太了解
你进入到css样例里面仔细看下里面有没有url或者src之类的超链接,很可能你的js放的位置跟css的目录有差别,所以导致它找不到相应的路径
你的代码在哪里呢。。。。。。。。简单贴一下?
这是我引入ueditor的js配置
//ueditor富文本框
import './static/UE/ueditor.config.js'
import './static/UE/ueditor.all.min.js'
import './static/UE/lang/zh-cn/zh-cn.js'
import './static/UE/ueditor.parse.min.js'
这是添加的ueditor组件
<template>
<div>
<script id="ueid" type="text/plain"></script>
</div>
</template>
<script>
export default {
name: 'UE',
data () {
return {
editor: null
}
},
props: {
defaultMsg: {
type: String
},
config: {
type: Object
},
},
mounted() {
const _this = this;
this.editor = UE.getEditor("ueid", this.config); // 初始化UE
this.editor.addListener("ready", function () {
_this.editor.setContent(_this.defaultMsg); // 确保UE加载完成后,放入内容。
});
},
methods: {
getUEContent() { // 获取内容方法
return this.editor.getContent()
}
},
destroyed() {
this.editor.destroy();
}
}
</script>
这是我引用的地方
<button @click="getUEContent()">获取内容</button>
<div class="editor-container" type="text/javascript">
<UE :defaultMsg=defaultMsg :config=config ref="ue"></UE>
</div>
getUEContent() {
let content = this.$refs.ue.getUEContent();
this.$notify({
title: '获取成功,可在控制台查看!',
message: content,
type: 'success'
});
console.log(content)
}
正如楼上所勾选出来的红框里边的内容,你的文件没有完全引入。缺少的是ueditor.config.js里边配置的路径,路径要确认有没有问题,看样子你的路径配置错误,找不到文件了
我的不行啊 还是报css资源错误,有啥解决办法没啊