// app.js const { createApp } = Vue; const app = createApp({ data() { return { w: null, p: null, d: null, s: true, } }, async mounted() { // 生命周期钩子 - 挂载后 console.log('应用已挂载'); }, methods: { search() { Message.info('正在请求...', { duration: 5000000000000000 }); this.s = false; axios.get('https://zk.aoidc.top/api/api.php?q='+this.w) .then(response => { Message.closeAll(); this.s = true; if (response.data.results != null) { this.d = response.data.results; this.s = true; Message.success('已载入~', { duration: 2000 }); console.log(this.d); } else { Message.warning('失败', { duration: 2000 }); } }) }, } }); // 挂载到DOM元素 app.mount('#app');