v-html
<div
class="content iframe"
:class="[
'item-' + listValue + '-' + dataYear,
'item-' + listValue,
typeYearbooks
]"
v-html="replaceCss(docUrl)"
ref="fromDomNoke"
@click="
addComment(
$event,
changevalue,
changeYear,
typeYearbooks,
changetitle
)
"
></div>
data 内容
watch: {
dataYear: {
// 不起作用
handler(newValue) {
this.changeYear = newValue;
setTimeout(() => {
this.initStyle(this.typeYearbooks, this.listValue);
// console.log(this.$refs.fromDomNoke);
}, 100);
},
deep: true,
immediate: true
},
docUrl() {
this.$nextTick(function () {
//dom已更新(点击后切换)
this.initStyle(this.typeYearbooks, this.listValue);
})
},
},
网友评论