You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Vue计算属性调用数组some()方法报错,含Container未设置问题

Vue计算属性调用数组方法报错及容器相关问题

问题场景

我定义了一个空数组:

const arr = []

接着定义了一个计算属性:

const filtered_arr = computed(() => {
  //... 这里是自定义的过滤逻辑
})

之后我又定义了另一个计算属性filtered_arr2,想在第一个计算属性filtered_arr上调用some()方法,但因为filtered_arr并非实际数组而报错:

const filtered_arr2 = computed(() => {
  filtered_arr.some((e)=>{}) // <- 报错位置
})

当前出现的错误

  • some is not a function
  • Container is not set or can not be properly recognized. Use container() method to set it

我觉得自己的整体实现思路可能存在问题...

内容的提问来源于stack exchange,提问作者endermaanny monooo

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.14 22:35:57