fix(NoticeBar): allow dynamic setting of scrollable (#6190)

This commit is contained in:
neverland 2020-04-30 17:39:34 +08:00 committed by GitHub
parent c885801f32
commit d68943cd73
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -37,10 +37,9 @@ export default createComponent({
}, },
watch: { watch: {
scrollable: 'start',
text: { text: {
handler() { handler: 'start',
this.start();
},
immediate: true, immediate: true,
}, },
}, },
@ -69,7 +68,7 @@ export default createComponent({
this.duration = 0; this.duration = 0;
}, },
start(){ start() {
this.$nextTick(() => { this.$nextTick(() => {
const { wrap, content } = this.$refs; const { wrap, content } = this.$refs;
if (!wrap || !content) { if (!wrap || !content) {
@ -87,7 +86,7 @@ export default createComponent({
this.reset(); this.reset();
} }
}); });
} },
}, },
render() { render() {