1.在main.js中需要添加一个配置的东西
// 是否使用生产模式改为false,我们在开发过程中才会有具体报错原因
Vue.config.productionTip = false
效果如下
import Vue from 'vue'
import App from './App.vue'
// 是否使用生产模式改为false,我们在开发过程中才会有具体报错原因
Vue.config.productionTip = false
new Vue({
render: h => h(App),
}).$mount('#app')
我们写组件的时候,template有下划线提示,解决方式
2.解决方法jsconfig.js文件中添加
"jsx": "preserve",
效果如下
{
"compilerOptions": {
"target": "es5",
"module": "esnext",
"baseUrl": "./",
"jsx": "preserve",
"moduleResolution": "node",
"paths": {
"@/*": [
"src/*"
]
},
"lib": [
"esnext",
"dom",
"dom.iterable",
"scripthost"
]
}
}
3.我们写组件的时候,会遇到提示组件名不规范的问题
报错提示
error Component name "index" should always be multi-word vue/multi-word-component-names
只需要在vue.config.js中配置下就好了,这个是配置文件,配置好后,需要重启项目
const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
transpileDependencies: true,
lintOnSave:false
})