国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 語言 > JavaScript > 正文

vue項目中使用ueditor的實例講解

2024-05-06 15:21:09
字體:
來源:轉載
供稿:網(wǎng)友

以vue-cli生成的項目為例

1.static文件夾下先放入ueditor文件

2.index.html添加如下代碼

<script type="text/javascript" charset="utf-8" src="static/ueditor/ueditor.config.js"></script><script type="text/javascript" charset="utf-8" src="static/ueditor/ueditor.all.min.js"></script>

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-lineexport 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的實例講解就是小編分享給大家的全部內容了,希望能給大家一個參考,也希望大家多多支持錯新站長站。

發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表

圖片精選

主站蜘蛛池模板: 峨山| 酒泉市| 鹿泉市| 灌阳县| 盐津县| 堆龙德庆县| 西平县| 平谷区| 梅河口市| 新兴县| 黑水县| 西贡区| 崇礼县| 苏尼特右旗| 赤城县| 罗甸县| 托克逊县| 法库县| 昌江| 湘潭市| 天津市| 南汇区| 龙陵县| 孟连| 迁安市| 延吉市| 汝州市| 绥芬河市| 中方县| 普宁市| 阳山县| 东兴市| 沾益县| 康定县| 湛江市| 大庆市| 蓝山县| 临泽县| 麻栗坡县| 南平市| 象州县|