以vue-cli生成的项目为例
1.static文件夹下先放入ueditor文件
2.index.html添加如下代码
<script type="text/javascript" charset="utf-8" src="/UploadFiles/2021-04-02/ueditor.config.js">3.webpack.base.conf.js添加如下配置
externals: { 'UE': 'UE', },4.index.html中添加
<script type="text/javascript"> window.UEDITOR_HOME_URL = "/static/ueditor/";//配置路径设定为UEditor所放的位置 </script>5.editor组件
<template> <div> <mt-button @click="geteditor()" type="danger">获取</mt-button> <script id="editor" type="text/plain" style="width:1024px;height:500px;"></script> </div> </template> <script> const UE = require('UE');// eslint-disable-line export default { name: 'editorView', data: () => ( { editor: null, } ), methods: { geteditor() { console.log(this.editor.getContent()); }, }, mounted() { this.editor = UE.getEditor('editor'); }, destroyed() { this.editor.destroy(); }, }; </script> <style> </style>以上这篇vue项目中使用ueditor的实例讲解就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持。
最新资源
- 陈慧娴.2018-Priscilla-Ism演唱会3CD(2024环球红
- 郑秀文.1999-我应该得到(国)【华纳】【WAV+CUE】
- 陈家慧.2011-钢琴酒吧2CD【龙吟唱片】【WAV+CUE
- 证声音乐图书馆《雨季 蓝调吉他 Rainy Blues》[
- 证声音乐图书馆《雨季 蓝调吉他 Rainy Blues》[
- 赞多《序章》[320K/MP3][45.54MB]
- 许巍.2004-每一刻都是崭新的【步升大风】【WAV+
- 群星.2024-四方馆影视原声带【韶愔音乐】【FLAC
- 陈雷.1997-安锁咧【金圆唱片】【WAV+CUE】
- 关淑怡.2013-MY.FAVORITE.SK.3CD【环球】【WAV+