扫码关注官方订阅号
如题,在git上找了很久vue2的富文本编辑插件但是一直未找到 所以想问一下有没有用过相关插件的朋友~~求推荐
学习是最好的投资!
我试了试,也可以在vue里使用类似ueditor这类的编辑器,以vue-cli生成的项目为例
index.html
<script type="text/javascript" charset="utf-8" src="http://127.0.0.1/vue/static/utf8-php/ueditor.config.js"></script> <script type="text/javascript" charset="utf-8" src="http://127.0.0.1/vue/static/utf8-php/ueditor.all.min.js"> </script>
webpack.base.cong.js
externals: { 'UE': 'UE', },
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>
markcook
基于Vue2.0+Vuex2.0构建的富文本编辑器
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
我试了试,也可以在vue里使用类似ueditor这类的编辑器,以vue-cli生成的项目为例
index.html
webpack.base.cong.js
editor组件
markcook
基于Vue2.0+Vuex2.0构建的富文本编辑器