[Vue warn]: Invalid prop: custom validator check failed for prop “index“
Foreword: I am watching the background management project of bilibili, the error reporting problems encountered and the solutions
report errors:
Original code:
Modification code:
<el-menu
default-active="1-4-1"
class="el-menu-vertical-demo"
@open="handleOpen"
@close="handleClose"
:collapse="isCollapse"
>
<el-menu-item
v-for="item in noChildren"
:index="item.path"
:key="item.path"
>
<i :class="'el-icon-' + item.icon"></i>
<span slot="title">{{ item.label }}</span>
</el-menu-item>
<el-submenu
v-for="item in hasChildren"
:index="item.path + ''"
:key="item.path"
>
<template slot="title">
<i :class="'el-icon-' + item.icon"></i>
<span slot="title">{{ item.label }}</span>
</template>
<el-menu-item-group
v-for="(subItem, subIndex) in item.children"
:key="item.path"
>
<el-menu-item :index="subIndex + ''">{{ subItem.label }}</el-menu-item>
</el-menu-item-group>
</el-submenu>
</el-menu>
Read More:
- The page console error [Vue warn]: Invalid prop: custom validator check failed for prop “status“
- [Vue warn]: Invalid prop: custom validator check failed for prop “navigationBarTextStyle“.
- [Vue warn]: Invalid prop: type check failed for prop “index“. Expected String, got Undefined
- [Solved] Invalid prop: type check failed for prop “index“. Expected String, got Undefined
- [Solved] Invalid prop: type check failed for prop “modelValue“. Expected Number…
- [Vue warn]: Invalid prop: type check failed for prop [How to Solve]
- Please transfer a valid prop path to form item
- [Solved] Error in mounted hook: “Error: please transfer a valid prop
- [Vue warn]: Error in mounted hook: “Error: please transfer a valid prop path to form item“
- Vue modifies the value passed by props error: Avoid mutating a prop directly since the value will be overwritten whenever the par
- How to Solve Error: [Vue warn]: Missing required prop: “value”
- [Vue warn]Error in mounted hook: “Error: please transfer a valid prop path to form item“
- [Solved] el-date-picker Error: Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders.
- How to Solve VUE Error: Avoid mutating a prop directly since the value will be overwritten …
- [Solved] Error in v-on handler: “Error: please transfer a valid prop path to form item
- [Solved] Uniapp project use vant icon Error: (module build failed from./node_modules/postcss loader/SRC/index)
- [Solved] Failed to execute ‘getRangeAt‘ on ‘Selection‘: 0 is not a valid index.“
- [Solved] Cannot read properties of undefined (reading ‘propsData‘)“
- Vue: initialize failed: invalid DOM [How to Solve]
- [Solved] Custom components with click events do not work