<>1. Dynamic insert component

Define the element that needs to be inserted into the page as a component , Operate again .
reference resources :https://jintang.github.io/2018/03/27/vue Add components dynamically /
<https://jintang.github.io/2018/03/27/vue%E5%8A%A8%E6%80%81%E6%B7%BB%E5%8A%A0%E7%BB%84%E4%BB%B6/>

<>2. Add elements directly to the page

Page structure code :
<ul> <li v-for="(item, index) in itemArr" :key="index"> {{index +
1}}.<el-input v-model="items[index]" ></el-input> <span
@click="delete(index)"> delete </span> /li> </ul> <span @click="addEle"
pointer">+ Add elements </span>
data initialization :
data() { return { items: [0] ele: '' } }
method :
// Click Add addExceptPrice() { this.ele ++; this.itemArr.push(this.ele) }, // Delete an item
deleteExceptPrice(index) { this.itemArr.splice(index, 1); }
Pay attention to micro blog , WeChat official account search front end , Let's learn and grow together .