<el-button
icon="el-icon-caret-right"
size="mini"
class="table_button"
@click="handlePlay(scope.row)"
>播放</el-button>
handlePlay(row) {
if (row.recording) {
this.play();
} else {
this.$message({
message: "播放失败!管理员似乎没有上传录音!",
type: "warning",
});
}
}
play() {
this.dialogVisible = true;
this.$nextTick(() => {
this.$refs.audio.play();
});
}
play方法中为什么需要用到nextTick,因为操作了dom吗
因为数据更改,会更新组件,页面会重新进行渲染