<template>
<Steps :current="1">
<Step v-for="(item, index) of arr" :content="(item[0] && item[0].a) || item"></Step>
</Steps>
</template>
<script>
export default {
data: () => ({arr: [[{a: 11}], 22, 33, 44]}),
methods: {},
mounted() {
let that = this
setTimeout(() => {
// 方法1
// that.arr[2] = 333 // 单独不生效
// that.arr = JSON.parse(JSON.stringify(that.arr)) // 生效
// 方法2
// that.$set(that.arr, 2, 333) // 生效
// 方法3
that.arr[0][0].a = 111
// that.arr[1] = 2222
// 方法4,生效
// that.arr.push(55)
// that.arr.splice(1, 0, 55, 66)
console.log('---- ', that.arr)
}, 1500)
}
}
</script>
网友评论