How to Solve Vue Space Line Wrap Error

The main reason for this problem is that you set eslint (normalized code, you can reinitialize and turn off eslint) during initialization. The solution is as follows (recommended method 3, simple):

Method 1:

Find the build folder in the directory with the webpack.base.config.js file on it. Comment out the code and restart it

Because the project I created with Vue cli does not have a build folder, the webpack.base.config.js file cannot be found and cannot be solved by the above method, so ↓

Method 2:  

Open the. Eslintrc.JS file in the root directory and add the following code

chainWebpack: config => {
    config.module
      .rule('vue')
      .use('vue-loader')
      .loader('vue-loader')
      .tap(options => {
        options.compilerOptions.preserveWhitespace = true
        return options
      })
  }

As shown in the figure:

Method 3:

Another method is very simple. Just delete the strict mode configuration (restart the editor after deletion!), as shown in the figure:

Similar Posts: