编程开源技术交流,分享技术与知识

网站首页 > 开源技术 正文

vue下使用百度ueditor编辑器(ueditor vue)

wxchong 2024-10-07 17:22:53 开源技术 44 ℃ 0 评论

vue 2.0下使用百度ueditor编辑器,推荐使用vue-ueditor
github 地址:https://github.com/SilentTiger/vue-ueditor
相关 Issue:https://github.com/SilentTiger/vue-ueditor/issues?q=is%3Aissue+is%3Aclosed

Install

npm i vue-ueditor --S

Setup

首先,在需要使用 UEditor 的页面引入 UEditor, 并将其添加到 template

Note:

Couldn't find preset "es2015" relative to directory问题解决

是因为项目没使用ES标准,但是引入的vue-ueditor使用了ES标准,所以编译会报错,解决办法如下:

npm install babel-preset-es2015 --save-dev

然后需要在项目跟目录下的.babelrc文件中,找到“presets”项并加入“es2015”

本文暂时没有评论,来添加一个吧(●'◡'●)

欢迎 发表评论:

最近发表
标签列表