diff --git a/components/AiDvViewer.vue b/components/AiDvViewer.vue index 89a95b98..780f0a6e 100644 --- a/components/AiDvViewer.vue +++ b/components/AiDvViewer.vue @@ -36,8 +36,11 @@ export default { } }, watch: { - id(v) { - this.getInfo(v) + id: { + handler(v) { + v && this.getInfo(v) + }, + immediate: true } }, data() { @@ -56,9 +59,6 @@ export default { meta: {} } }, - created() { - this.getInfo(this.id) - }, mounted() { this.$nextTick(() => { let content = document.querySelector('#dv-full-screen-container') @@ -74,9 +74,7 @@ export default { methods: { getInfo(id) { this.component = null - id && this.instance.post(`${this.urlPrefix}/appdiylargescreen/queryLargeScreenDetailById?id=${id}`, null, { - throttle: 2000 - }).then(res => { + id && this.instance.post(`${this.urlPrefix}/appdiylargescreen/queryLargeScreenDetailById?id=${id}`).then(res => { if (res?.data) { const config = JSON.parse(res.data.config) if (config.custom) {