完善录音时长功能
This commit is contained in:
@@ -50,6 +50,12 @@
|
||||
<script>
|
||||
export default {
|
||||
name: 'QualityCoveragePopup',
|
||||
props: {
|
||||
openTrigger: {
|
||||
type: Number,
|
||||
default: 0
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
coverageRate: '87.5',
|
||||
@@ -63,12 +69,34 @@ export default {
|
||||
]
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
openTrigger(newVal) {
|
||||
// 当触发器变化时,自动打开弹窗
|
||||
if (newVal > 0) {
|
||||
this.$nextTick(() => {
|
||||
this.open();
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
this.$refs.popup.open()
|
||||
// 安全地访问 refs,如果组件还未准备好则重试
|
||||
if (this.$refs && this.$refs.popup) {
|
||||
this.$refs.popup.open();
|
||||
} else {
|
||||
// 如果 refs 还未准备好,延迟重试
|
||||
setTimeout(() => {
|
||||
if (this.$refs && this.$refs.popup) {
|
||||
this.$refs.popup.open();
|
||||
}
|
||||
}, 100);
|
||||
}
|
||||
},
|
||||
close() {
|
||||
this.$refs.popup.close()
|
||||
if (this.$refs && this.$refs.popup) {
|
||||
this.$refs.popup.close();
|
||||
}
|
||||
},
|
||||
onPopupChange(e) {
|
||||
if (!e.show) {
|
||||
|
||||
Reference in New Issue
Block a user