通过在vue项目中使用ueditor(详细教程)
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了通过在vue项目中使用ueditor(详细教程),小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含1242字,纯文字阅读大概需要2分钟。
内容图文
下面我就为大家分享一篇vue项目中使用ueditor的实例讲解,具有很好的参考价值,希望对大家有所帮助。以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> <p> <mt-button @click="geteditor()" type="danger">获取</mt-button> <script id="editor" type="text/plain" style="width:1024px;height:500px;"></script> </p> </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实现树形菜单效果
VUE重点问题总结
p5.js入门教程之键盘交互
以上就是通过在vue项目中使用ueditor(详细教程)的详细内容,更多请关注Gxl网其它相关文章!
内容总结
以上是互联网集市为您收集整理的通过在vue项目中使用ueditor(详细教程)全部内容,希望文章能够帮你解决通过在vue项目中使用ueditor(详细教程)所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。