代码之家  ›  专栏  ›  技术社区  ›  IvanS95

如何让CSS IntelliSense在Nuxt项目中工作?

  •  0
  • IvanS95  · 技术社区  · 7 年前

    我正在做一个Nuxt.js项目,我创建了一个Docker映像来处理所有的事情;我也试着包括 MDBVue 作为一个CSS库,在阅读之后,我明白为了使用它,我必须将它作为一个插件,并在我的网站上引用它 nuxt.config.js 文件;

    module.exports = {
      /*
      ** Headers of the page
      */
      head: {
        title: 'skfe',
        meta: [
          { charset: 'utf-8' },
          { name: 'viewport', content: 'width=device-width, initial-scale=1' },
          { hid: 'description', name: 'description', content: 'Nuxt.js project' }
        ],
        link: [
          { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }
        ]
      },
      /*
      ** Customize the progress bar color
      */
      loading: { color: '#3B8070' },
      css: [
        { src: "bootstrap-css-only/css/bootstrap.min.css" },
        { src: "mdbvue/build/css/mdb.css" }
      ],
      /*
      ** Build configuration
      */
      build: {
        /*
        ** Run ESLint on save
        */
        extend (config, { isDev, isClient }) {
          if (isDev && isClient) {
            config.module.rules.push({
              enforce: 'pre',
              test: /\.(js|vue)$/,
              loader: 'eslint-loader',
              exclude: /(node_modules)/
            })
          }
        }
      }
    }
    

    现在CSS类可以工作了,但是我不能从VSCode中获得任何自动完成,我必须输入完整的类名;这是正常行为还是有办法让IntelliSense处理我的Vue文件?

    1 回复  |  直到 7 年前
        1
  •  3
  •   Bob Fanger    7 年前
    推荐文章