野生java研究僧 2022-08-16 00:07 采纳率: 100%
浏览 487
已结题

使用el-select-v2报错

问题遇到的现象和发生背景

使用el-select-v2报错,无法正常渲染,使用的是vue3,elementui-plus框架

问题相关代码,请勿粘贴截图

html:

   <el-select-v2
          :options="interestTagList"
          placeholder="请选你感兴趣的标签,可以设置多个,支持搜索"
          :multiple="true"
          :autocomplete="true"
          :filterable="true"
          @change="selectV2OnChange"
          size="large"
          style="width: 70%;float: right;margin-bottom: 20px"
          no-data-text="暂无数据,换个标签试试?"
        >
          <template #default="{ item }">
            <span>{{ item.label }}</span>
            <span>
              {{ item.value }}
            </span>
          </template>
        </el-select-v2>

绑定的数组:

   interestTagList: [
        { label: 'java', value: '1' },
        { label: 'linux', value: '2' },
        { label: 'JavaScript', value: '3' },
        { label: 'html', value: '4' },
        { label: 'css', value: '5' },
        { label: 'python', value: '6' },
        { label: 'redis', value: '7' },
        { label: 'mysql', value: '8' },
        { label: 'netty', value: '9' },
        { label: 'bootstrap', value: '10' },
      ]
运行结果及报错内容

select-dropdown.vue?b561:65 Uncaught (in promise) TypeError: arr.includes is not a function
at contains (select-dropdown.vue?b561:65:1)
at isItemSelected (select-dropdown.vue?b561:87:1)
at eval (select-dropdown.vue?b561:189:1)
at Proxy.renderFnWithContext (runtime-core.esm-bundler.js?d2d:853:1)
at Proxy.render (build-list.ts?8c65:336:1)
at renderComponentRoot (runtime-core.esm-bundler.js?d2d:896:1)
at ReactiveEffect.componentUpdateFn [as fn] (runtime-core.esm-bundler.js?d2d:5575:1)
at ReactiveEffect.run (reactivity.esm-bundler.js?89dc:185:1)
at instance.update (runtime-core.esm-bundler.js?d2d:5689:1)
at setupRenderEffect (runtime-core.esm-bundler.js?d2d:5703:1)

我的解答思路和尝试过的方法

应该是options的问题,我options传递为空就没问题,传递有值的数组就报错,我这个数组也是按照官网的那种方式进行传值的

我想要达到的结果

不进行报错,能正常进行选

  • 写回答

1条回答 默认 最新

报告相同问题?

问题事件

  • 系统已结题 12月25日
  • 已采纳回答 12月17日
  • 创建了问题 8月16日

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog