|
@@ -0,0 +1,32 @@
|
|
1
|
+### neditor使用:
|
|
2
|
+
|
|
3
|
+1、引入资源
|
|
4
|
+1.1 在static\neditor
|
|
5
|
+1.2 在根目录下index.html下
|
|
6
|
+<script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>
|
|
7
|
+<script src="<%= htmlWebpackPlugin.options.path %>/neditor/neditor.config.js"></script>
|
|
8
|
+<script src="<%= htmlWebpackPlugin.options.path %>/neditor/neditor.all.min.js"></script>
|
|
9
|
+<script src="<%= htmlWebpackPlugin.options.path %>/neditor/neditor.service.js"></script>
|
|
10
|
+<script src="<%= htmlWebpackPlugin.options.path %>/neditor/i18n/zh-cn/zh-cn.js"></script>
|
|
11
|
+<script src="<%= htmlWebpackPlugin.options.path %>/neditor/neditor.parse.min.js"></script>
|
|
12
|
+
|
|
13
|
+2、自定义components,在src下新建Neditor/index.vue,具体见src\components\Neditor\index.vue
|
|
14
|
+
|
|
15
|
+3、使用:
|
|
16
|
+3.1、引入自定义components:
|
|
17
|
+import Neditor from '@/components/Neditor'
|
|
18
|
+3.2、注册:
|
|
19
|
+components: {
|
|
20
|
+ Neditor,
|
|
21
|
+ ......
|
|
22
|
+},
|
|
23
|
+3.3
|
|
24
|
+
|
|
25
|
+<el-form-item label="机构介绍:" prop="org_introduction">
|
|
26
|
+ <keep-alive><!--网上说用百度ueditor时,要用keep-alive-->
|
|
27
|
+ <neditor ref="neditor" id="editor" v-bind:r_content="form.org_introduction"> </neditor> <!--这里是Neditor-->
|
|
28
|
+ </keep-alive>
|
|
29
|
+</el-form-item>
|
|
30
|
+3.4
|
|
31
|
+提交时,需要获取富文本里的内容:
|
|
32
|
+this.form.org_introduction = this.$refs.neditor.content;
|