nuxt.js基础入门教程

nuxt入门教程(六)nuxt加载jquery和less解析器

2019-10-31  本文已影响0人  党云龙

安装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">

然后就可以尽情的玩耍了。

上一篇 下一篇

猜你喜欢

热点阅读