diff --git a/src/components/AiOpenData.vue b/src/components/AiOpenData.vue index c73522c6..8a311a46 100644 --- a/src/components/AiOpenData.vue +++ b/src/components/AiOpenData.vue @@ -20,13 +20,10 @@ export default { ...mapActions(['injectJWeixin']) }, mounted() { - this.injectJWeixin().then(() => { - WWOpenData.bind(this.$el) - WWOpenData.on('error', res => { - console.log(res) - }) - WWOpenData.on('update', res => { - console.log(res) + if (window?.WWOpenData) WWOpenData.bind(this.$el) + else this.injectJWeixin().then(() => { + this.$nextTick(() => { + WWOpenData.bind(this.$el) }) }) }