javascript - vue2.0 dynamically loads multiple identical components, enters different values ​​into the data in the components, and when closing the non-last component, the value destroyed is the last component value.
黄舟
黄舟 2017-07-05 11:00:36
0
1
1411

vue2.0 dynamically loads multiple identical components, enters different values ​​into the data in the components, and when closing the non-last component, the value destroyed is the last component value.

Component loading method:
component is an array. Get the component to be rendered through a custom event and push it into the component.
<component :is='component[index].component' :params='component[index].params'/>

Close the component:
this.component.splice(i,1);

黄舟
黄舟

人生最曼妙的风景,竟是内心的淡定与从容!

reply all(1)
世界只因有你

this.component.splice(i,1);
After destroying the first one, the second one becomes the first one and the third one becomes the second one

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template