murilo
2 weeks ago
73
1
Vue

Dynamic Object name with Javascript

Posted 2 weeks ago by murilo

there is any how I make a dynamic object names, something like that -

the result , should be like this -

	{{ getList }} 

      { form.0.list { type: 1 } , form.1.list { type: 2 } }

the function

	 getList(){
                let list = [];
                for(let field in this.items){

                    list.push({
                        'form.' + [list ] + '.list': {
                            type: 1,
                         },
                    
                    });
				return list ;
                }

Please sign in or create an account to participate in this conversation.