vue使用vue-ueditor碰到的问题(Couldn't find preset "es2015" relative to directory)
2017-04-15 17:35
579 查看
1、安装vue-ueditor
npm i vue-ueditor --S
将安装包下面的UEditor
代码包复制到项目static目录下面
UEditor
代码包(\node_modules\vue-ueditor\static\ueditor1_4_3_3)或者在下载最新源码和各个语言版本的http://ueditor.baidu.com/website/download.html#ueditor
2、使用
<template>
<div>
<p>fdgdgd</p>
<VueEditor ueditorPath="../../static/ueditor1_4_3_3-utf8-net" @ready="editorReady"></VueEditor>
</div>
</template>
3、Couldn't find preset "es2015" relative to directory问题解决
由于是菜鸟没使用ES标准,而引入的vue-ueditor使用了ES标准,所以编译会报错,解决办法如下:
然后需要在webpack.base.conf.js文件中加入如下代码
ok,现在可以使用vue-uediter了
npm i vue-ueditor --S
将安装包下面的UEditor
代码包复制到项目static目录下面
UEditor
代码包(\node_modules\vue-ueditor\static\ueditor1_4_3_3)或者在下载最新源码和各个语言版本的http://ueditor.baidu.com/website/download.html#ueditor
2、使用
<template>
<div>
<p>fdgdgd</p>
<VueEditor ueditorPath="../../static/ueditor1_4_3_3-utf8-net" @ready="editorReady"></VueEditor>
</div>
</template>
import VueEditor from 'vue-ueditor' components:{ VueEditor }, methods:{ editorReady(editorInstance){ editorInstance.setContent('Hello world!<br>编辑初始化内容') } }
3、Couldn't find preset "es2015" relative to directory问题解决
由于是菜鸟没使用ES标准,而引入的vue-ueditor使用了ES标准,所以编译会报错,解决办法如下:
npm i a252 nstall babel-preset-es2015 --save-dev
然后需要在webpack.base.conf.js文件中加入如下代码
module: { loaders: [ { test: /\.js$/, exclude: /(node_modules|bower_components)/, loader: 'babel', query: { presets: ['es2015'] } } ] }
ok,现在可以使用vue-uediter了
相关文章推荐
- nodejs 运行后报错 Error: Couldn't find preset "es2015" relative to directory
- gulp报错“Error: Couldn't find preset "es2015" relative to directory”
- weex学习笔记-Couldn't find preset "es2015" relative to directory
- Error: Couldn't find preset "env" relative to directory
- react-native 运行github项目报错 Couldn't find preset “es2015” relative to directory
- Couldn't find preset “es2015” relative to directory
- vue,bug-Couldn’t find preset "es2015"
- Couldn't find preset “es2015” relative to directory
- mybatis 使用foreach时出现"The expression 'list' evaluated to a null value"问题
- 使用WinDbg调试Silverlight中遇到“Failed to find runtime DLL (clr.dll), 0x80004005”问题的解决方法之一
- Pulltorefresh使用中碰到的问题
- Android - "cause failed to find target android-14" 问题
- 使用Phalcon开发工具碰到的数据库问题"Table 'XXX' doesn't exist in database when dumping meta-data for XXX"
- 在Linux上安装netcdf4 ,解决"Can't find or link to the hdf5 library"的问题
- vss问题:客户端提示"Sourcesafe cannot find a default database.Would you like to select one?"
- 浅析:Pulltorefresh使用中碰到的问题
- 解决使用Struts2的s:textfield标签出现Unable to find setter method for attribute: style的问题
- [Android] "Failed to find Java version for 'C:\Windows\system32\java.exe"问题的解决方法
- 使用OGG"Loading data from file to Replicat"的方法应该注意的问题:replicat进程是前台进程
- 使用samba时出现"Failed to find entry for user..."