nuxt2.0项目创建(最新)

使用import需要babel编译写法如下

1
2
3
4
5
6
7
8
//修改1打开package.json文件
"dev": "cross-env NODE_ENV=development nodemon server/index.js --watch server --exec babel-node",
"start": "cross-env NODE_ENV=production node server/index.js --exec babel-node",

//修改2在根目录创建.babelrc
{"presets": ["es2015"]}

//安装yarn add babel-preset-es2015

项目中使用sass

1
$ yarn add sass-loader node-sass

辅助工具安装

MongoDB http://www.runoob.com/mongodb/mongodb-window-install.html

redis http://www.runoob.com/redis/redis-install.html

数据库可视化工具 https://robomongo.org/

修改nuxt.config.js

1
2
3
4
5
css: [
'element-ui/lib/theme-chalk/reset.css',
'element-ui/lib/theme-chalk/index.css',
// '~assets/css/main.css'
],
#

评论

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×