Skip to content

Commit 757999e

Browse files
author
wuzanhong
committed
fix: slots变化触发render更新
1 parent 36c2844 commit 757999e

2 files changed

Lines changed: 2 additions & 17 deletions

File tree

examples/docs/zh-CN/timeline.md

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ Timeline 可拆分成多个按照时间戳正序或倒序排列的 activity,
3030
{{activity.content}}
3131
</el-timeline-item>
3232
</el-timeline>
33-
<el-button @click="changeContent">改变内容</el-button>
3433
</div>
3534

3635
<script>
@@ -50,20 +49,6 @@ Timeline 可拆分成多个按照时间戳正序或倒序排列的 activity,
5049
timestamp: '2018-04-11'
5150
}]
5251
};
53-
},
54-
methods:{
55-
changeContent(){
56-
this.activities = [{
57-
content: '活动按期借书',
58-
timestamp: '2018-04-15'
59-
}, {
60-
content: '通过测试',
61-
timestamp: '2018-04-13'
62-
}, {
63-
content: '创建成功2',
64-
timestamp: '2018-04-11'
65-
}]
66-
}
6752
}
6853
};
6954
</script>

packages/timeline/src/item.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,8 @@ export default {
148148
}
149149
},
150150
151-
updated() {
152-
this.updatedSlots();
151+
beforeUpdate() {
152+
this.updateSlotsRender();
153153
}
154154
};
155155
</script>

0 commit comments

Comments
 (0)