From cc54aa6b1d29ac7dc265e4f66f2af61983dcf131 Mon Sep 17 00:00:00 2001 From: "wu.jian2" Date: Thu, 17 Aug 2023 10:55:04 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=AF=B9=E4=BA=8E=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=EF=BC=8C=E6=B7=BB=E5=8A=A0=E5=AF=B9=E6=98=AF?= =?UTF-8?q?=E5=90=A6=E6=8B=A5=E6=9C=89customStyle=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E7=9A=84=E5=88=A4=E6=96=AD=EF=BC=8C=E5=A6=82=E6=9E=9C=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E6=B2=A1=E6=9C=89=E6=AD=A4=E6=96=B9=E6=B3=95=EF=BC=8C?= =?UTF-8?q?=E5=88=99=E5=9C=A8=E5=8A=A0=E8=BD=BD=E7=9A=84=E6=97=B6=E5=80=99?= =?UTF-8?q?=E4=B8=8D=E6=89=A7=E8=A1=8CcustomStyle=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data-room-ui/packages/RemoteComponents/index.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/data-room-ui/packages/RemoteComponents/index.vue b/data-room-ui/packages/RemoteComponents/index.vue index 44f44baa..2f753338 100644 --- a/data-room-ui/packages/RemoteComponents/index.vue +++ b/data-room-ui/packages/RemoteComponents/index.vue @@ -199,7 +199,12 @@ export default { this.chart.update(config.option) } this.changeChartConfig(config) - this.$refs['remoteComponent' + config.code]?.customStyle(config) + // 在this.$refs['remoteComponent' + config.code]这个实例里判断是否存在customStyle方法,如果存在则执行 + const componentInstance = this.$refs['remoteComponent' + config.code] + if (componentInstance && componentInstance.$options.methods && componentInstance.$options.methods.customStyle) { + // 调用 customStyle 方法 + this.$refs['remoteComponent' + config.code]?.customStyle(config) + } return config }, // 同步配置