Invalid prop: type check failed for prop “index“. Expected String with value “5“问题解决

简介: Invalid prop: type check failed for prop “index“. Expected String with value “5“问题解决

前几天一个月薪35k的兄弟,给我推了一个人工智能学习网站,看了一段时间挺有意思的。包括语音识别、机器翻译等从基础到实战都有,很详细,分享给大家。大家及时保存,说不定啥时候就没了。

Invalid prop: type check failed for prop “index”. Expected String with value "5"问题解决

在elementUI导航组件中加入后台数据驱动循环生成导航时会报如下错误

这里的错误是由index引起的,index的值必须是字符串,而且是单一的。

源代码

<el-menu default-active="2" class="el-menu-vertical-demo" @open="handleOpen" @close="handleClose">
      <el-submenu index="1">
        <template slot="title">导航一</template>
          <el-menu-item index="1-1">选项1</el-menu-item>
          <el-menu-item index="1-2">选项2</el-menu-item>
      </el-submenu>
    </el-menu>

解决

将index的值转化为字符串格式

可以这么干::index=“String(index)”

也可以这么干::index=" index + ’ ’ "

目录
打赏
0
0
0
0
19
分享
相关文章
【YashanDB 知识库】导入数据时报错:YAS-00008 type convert error:literal does not match format string
【YashanDB 知识库】导入数据时报错:YAS-00008 type convert error:literal does not match format string
【YashanDB知识库】YAS-00218 string conversion failed.
**简介:** 在数据导入导出过程中,使用 `imp` 工具导入 dump 文件时出现 `YAS-00218 string conversion failed` 错误。经分析,问题源于数据库字符集不匹配或原始 dump 文件中存在乱码。通过查看数据库服务端字符集(`show parameter character`)及采用折半查找法定位具体报错行,确认乱码导致导入失败。此问题影响版本为 23.2.1.100。
【YashanDB知识库】导入数据时报错:YAS-00008 type convert error:literal does not match format string
【YashanDB知识库】导入数据时报错:YAS-00008 type convert error:literal does not match format string
【YashanDB 知识库】exp 导出 csv 报错 YAS-00218 string conversion failed
**问题分类:** 数据导入导出 **关键字:** YAS-00218 string conversion failed **问题描述:** 使用 exp 导出成 CSV 时,报错 YAS-00218 string conversion failed。 **原因分析:** 数据库服务端字符集为 GBK,但客户端缺少 yasc_env.ini 文件,导致默认使用 UTF8 字符集。 **解决方法:** 创建 yasc_env.ini 文件并设置 CHARACTER_SET=GBK。 **影响范围:** 23.2.1.100
【YashanDB 知识库】YAS-00218 string conversion failed.
**简介:** 在使用 `imp` 导入 dump 文件时,遇到错误 YAS-00218 string conversion failed。通过检查数据库字符集及使用折半查找法定位问题行,发现原始 dump 文件中存在乱码,导致导入失败。此问题影响版本 23.2.1.100。建议检查并修正源数据字符编码后再进行导入操作。
Java更新数据库报错:Data truncation: Cannot create a JSON value from a string with CHARACTER SET 'binary'.
在Java中,使用mybatis-plus更新实体类对象到mysql,其中一个字段对应数据库中json数据类型,更新时报错:Data truncation: Cannot create a JSON value from a string with CHARACTER SET 'binary'.
845 4
Java更新数据库报错:Data truncation: Cannot create a JSON value from a string with CHARACTER SET 'binary'.
作用域通信对象:session用户在登录时通过`void setAttribute(String name,Object value)`方法设置用户名和密码。点击登录按钮后,跳转到另外一个页面显示用户
该博客文章通过示例演示了如何使用session对象的`setAttribute`和`getAttribute`方法在不同页面间传递和显示用户的用户名和密码信息,并说明了如何设置会话的有效期。
作用域通信对象:session用户在登录时通过`void setAttribute(String name,Object value)`方法设置用户名和密码。点击登录按钮后,跳转到另外一个页面显示用户
|
11月前
|
构造String问题之在JDK 9及更高版本中,直接访问String对象的coder和value属性,如何实现
构造String问题之在JDK 9及更高版本中,直接访问String对象的coder和value属性,如何实现
107 0
|
11月前
|
SQL
Typecho——Argument 1 passed to Typecho\Router::get() must be of the type string
Typecho——Argument 1 passed to Typecho\Router::get() must be of the type string
117 0
|
11月前
|
解决Invalid `Podfile` file: no implicit conversion of nil into String
解决Invalid `Podfile` file: no implicit conversion of nil into String
174 0

热门文章

最新文章

AI助理

你好,我是AI助理

可以解答问题、推荐解决方案等

登录插画

登录以查看您的控制台资源

管理云资源
状态一览
快捷访问