- {
{item.name}}
//i
↓
↑
Vue.config.productionTip = false//不去提示
new Vue({
el: "#app",
data() {
return {
list:[
{id:111,name:"aaa"},
{id:222,name:"bbb"},
{id:333,name:"ccc"},
{id:444,name:"ddd"}
]
}
},
methods:{
down(i){
let temp = this.list[i]
this.$set(this.list,i,this.list[i+1])
this.$set(this.list,i+1,temp)
},