|
5 lat temu | |
---|---|---|
.. | ||
README.md | 5 lat temu | |
orginfo.vue | 5 lat temu |
1、引入资源
1.1 在static\neditor
1.2 在根目录下index.html下
<script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>
<script src="<%= htmlWebpackPlugin.options.path %>/neditor/neditor.config.js"></script>
<script src="<%= htmlWebpackPlugin.options.path %>/neditor/neditor.all.min.js"></script>
<script src="<%= htmlWebpackPlugin.options.path %>/neditor/neditor.service.js"></script>
<script src="<%= htmlWebpackPlugin.options.path %>/neditor/i18n/zh-cn/zh-cn.js"></script>
<script src="<%= htmlWebpackPlugin.options.path %>/neditor/neditor.parse.min.js"></script>
2、自定义components,在src下新建Neditor/index.vue,具体见src\components\Neditor\index.vue
3、使用
3.1、引入自定义components:
import Neditor from '@/components/Neditor'
3.2、注册:
components: {
Neditor,
......
},
3.3
<el-form-item label="机构介绍:" prop="org_introduction">
<keep-alive><!--网上说用百度ueditor时,要用keep-alive-->
<neditor ref="neditor" id="editor" v-bind:r_content="form.org_introduction"> </neditor> <!--这里是Neditor-->
</keep-alive>
</el-form-item>
3.4 4. 提交时,需要获取富文本里的内容:
this.form.org_introduction = this.$refs.neditor.content;