我无法过滤数据
数组列表类似于 this :
{uid: 11111, 22222, 33333, 44444, 55555, 66666, 77777 }
并且我想要像 this 这样的过滤器:
filterdData: {
{'index':1 , 'uid':'11111' } ........
请帮助...
我尝试...
export default {
name: 'extuserList',
components: {
DatePicker
},
data () {
return {
isShowForm: false,
oid: '',
uidList: {
NO:'',
UID:''
}
originData: ['11111',222222','333333','444444' }
}
},
filterdData: {
{'index':1 , 'uid':'11111' } ........
答案 0 :(得分:0)
尝试这样
var a =[11111, 22222, 33333, 44444, 55555, 66666, 77777 ];
var f =[[Math.floor(a[0]/10000),a[0]]];
var z = []
for(var i=0;i<a.length;i++){
f =[[Math.floor(a[i]/10000),a[i]]];
z.push(...f);
}
console.log(z);
答案 1 :(得分:0)
也许这会有所帮助?
var t = ['11111', '222222','333333','444444'].map(function(item, index) {
return {
item, index
};
});