安装jquery的方法
cnpm install jquery@3.1.0 -S-d
然后nuxt.config中加入这一段
build: {
vendor: ['element-ui','axios','jquery'],
plugins: [
new webpack.ProvidePlugin({
'$': 'jquery'
})
],
postcss: {
preset: {
features: {
customProperties: false
}
}
},
/*
** You can extend webpack config here
*/
extend(config, ctx) {}
}
使style支持less
nuxt中并不包含less解析工具
cnpm install less less-loader -S-d
安装完毕以后,跟vuecli中使用的方法一样。
<style lang="less">
然后就可以尽情的玩耍了。