AngularMatStepper无法识别两个字符串数组中的缓存值(但可以成功识别另一个字符串数组的值)
创始人
2024-10-28 12:01:20
0

将需要缓存的字符串数组转换为对象数组,然后通过维护对象数组来保存缓存值。以下是代码示例:

在组件中定义对象数组:

cachedValues = [{id: 'array1', values: []}, {id: 'array2', values: []}, {id: 'array3', values: []}];

在需要缓存的地方,从字符串数组转换为对象数组:

const newArray1 = arr1.map((val) => {return {value: val};});
const newArray2 = arr2.map((val) => {return {value: val};});
const newArray3 = arr3.map((val) => {return {value: val};});

this.cachedValues[0].values = newArray1;
this.cachedValues[1].values = newArray2;
this.cachedValues[2].values = newArray3;

在需要使用缓存值的地方,从对象数组转换为字符串数组:

const cachedArr1 = this.cachedValues[0].values.map((obj) => obj.value);
const cachedArr2 = this.cachedValues[1].values.map((obj) => obj.value);
const cachedArr3 = this.cachedValues[2].values.map((obj) => obj.value);

相关内容

热门资讯

今日百科!sohoo开挂辅助,... 今日百科!sohoo开挂辅助,aapoker ai插件,一贯是有挂(有挂详情)一、可以开透视的定义与...
最新通报!we poker游戏... 最新通报!we poker游戏下,扑克之星辅助,其实有挂(有挂方式)1、全新机制【ai辅助工具激活码...
分享实测!wpk透视辅助方法,... 分享实测!wpk透视辅助方法,wepoker有辅助插件吗,本来是真的有挂(有挂总结)1、起透看视 辅...
重大消息!aapoker插件,... 重大消息!aapoker插件,hhpoker软件可以玩吗,其实是有挂(有挂总结)能透视中分为三种模型...
必备攻略!wepokerplu... 必备攻略!wepokerplus辅助,wepoker买钻石有用吗,确实存在有挂(详细教程);破解侠是...
重大消息!德普之星透视免费,w... 重大消息!德普之星透视免费,wepoker网页版透视方法,竟然是有挂(有挂存在)1、该软件可以轻松地...
总算明白!hhpoker辅助软... 总算明白!hhpoker辅助软件是真的么,wpk官网下载链接,本来存在有挂(有挂详情)1、很好的工具...
一分钟了解!德州局透视脚本下载... 一分钟了解!德州局透视脚本下载安装最新版本,智星德州插件2024最新版,都是有挂(有挂工具)小薇(辅...
必看攻略!hhpoker有没有... 必看攻略!hhpoker有没有作弊辅助,wepoker有没有插件,真是真的是有挂(有挂分享)1、该软...
必备攻略!wepoker究竟有... 必备攻略!wepoker究竟有没有透视,aapoker辅助插件工具,好像存在有挂(有挂秘籍)1、有没...