加上return则组件数据只能当前组件可视,不会影响到其他组件 3 问题3 Component name “Home“ should always be multi-word vue/multi-word-component-names 报错! 原因:命名问题 方法:在vue.config.js中添加lintOnSave:false; java const{ defineConfig } = require('@vue/cli-service')module.exports= defineCon...
// eslint-disable-next-line vue/multi-word-component-names name: 'School', data() { return { info: '原生信息' } }, // 使用局部混入 mixins: [mixin1, mixin2], props: ['schoolName', 'schoolAddress', 'age'], }); 使用全局混入,main.js // 引入 Vue import Vue from 'vue' // ...
需要在package.json中修改 "vue/multi-word-component-names": 0 // 多字符组件名称,不设置检测 修改完成后继续跑,又报错,没路由,奇怪,我刚刚明明装了路由,有上面的截图 为证,但是就是不见了,可能在修改上面bug的时候百度好多种解决方法,试着试着不小心删掉了吧,既然没了那就重装一下吧。 安装完后又出现了...
// eslint-disable-next-line vue/multi-word-component-names name: "Login", data() { return { } }, methods: { } } 2.准备图片资源 两张背景图片,放到后端resources/static/file目录下,用于登录页背景和注册页背景 三张用户默认头像图片,放到后端resources/static/avatar目录下,用户表示男女其他...
'warn' : 'off', 'vue/multi-word-component-names': 'off', // 允许单字组件名 // 其他自定义规则... }, 4. 运行ESLint进行代码检查 你可以在package.json文件中添加一个脚本来运行ESLint: json "scripts": { "lint": "eslint --ext .js,.vue src" } 然后,你可以通过运行以下命令来检查你...
Component name “xxx“ should always be multi-word vue/multi-word-component-names 1. 升级为vue3后,文件的命名不符合规范,有2种解决方式: 一是修改组件文件的命名 另一种是更改eslint验证规则,内容如下 module.exports = { root: true, env: { ...
'vue/multi-word-component-names':'warn', }, }; 11. 出现 ERESOLVE unable to resolve dependency tree 怎么办? npm install 的时候如果出现 ERESOLVE unable to resolve dependency tree ,表示依赖安装冲突,可采用以下方式进行安装: npminstall--legacy-peer-deps ...
// eslint-disable-next-line vue/multi-word-component-names name: "Header", data() { return { user: JSON.parse(localStorage.getItem("CurUser")), }; }, props: { icon: String, }, methods: { collapse() { this.$emit("doCollapse"); ...
multipleTabs'export default {// eslint-disable-next-line vue/multi-word-component-namesname: 'home',components: {leftMenu,multipleTabs},data () {return {collapse: false}},mounted () {},methods: {hh (e) {this.$store.commit('tab', e)},collapseToggle () {this.collapse = !this....
此时会报错:error Component name "User" should always be multi-word vue/multi-word-component-names 意思是:错误组件名称“User”应始终为多词vue/多词组件名称 解决思路:vue中组件的命名规范需要以大写字母开头,并且最少以2个单词组成组件名称,这里因为只有1个单词User,所以eslint插件就认为这种写法不符合vue规...