用变量同时控制div的class和数据

.... // script data () { return { ... showMore: false } }, computed: { showTag () { if (this.showMore) { return this.data } else { return this.data.slice(0, 10) } } } .... dropDownMenu() { this.showMore = !this.showMore }

你可能感兴趣的:(用变量同时控制div的class和数据)