fix(frontend): 注册 ElementPlus 插件,修复 async 语法错误

- 统一在 createApp 后调用 app.use(ElementPlus)
- 为 handlePublish 添加 async 关键字
- 修正静态资源路径引用
- 解决登录页空白、按钮不可用问题

版本: v1.0.1
This commit is contained in:
lt
2026-04-27 16:45:58 +08:00
parent 5fe426fc90
commit b85b89a569
6 changed files with 14 additions and 5 deletions
+3 -1
View File
@@ -162,7 +162,9 @@
}
}
};
Vue.createApp(App).mount('#app');
const app = Vue.createApp(App);
app.use(ElementPlus);
app.mount('#app');
</script>
</body>
</html>
+3 -1
View File
@@ -107,7 +107,9 @@
.catch(() => { localStorage.removeItem('authToken'); window.location.href = '/'; });
}
};
Vue.createApp(LogsApp).mount('#app');
const app = Vue.createApp(LogsApp);
app.use(ElementPlus);
app.mount('#app');
</script>
</body>
</html>
+4 -2
View File
@@ -164,7 +164,7 @@
await this.fetchTopics();
} else { this.$message.info('仅待审查选题可优化'); }
},
handlePublish(topic) { this.$message.success('发布:' + topic.title); await this.fetchTopics(); },
async handlePublish(topic) { this.$message.success('发布:' + topic.title); await this.fetchTopics(); },
deleteTopic(id) {
this.$confirm('确定删除?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' })
.then(async () => { this.$message.success('删除成功'); await this.fetchTopics(); }).catch(() => {});
@@ -182,7 +182,9 @@
.catch(() => { localStorage.removeItem('authToken'); window.location.href = '/'; });
}
};
Vue.createApp(TopicsApp).mount('#app');
const app = Vue.createApp(TopicsApp);
app.use(ElementPlus);
app.mount('#app');
</script>
</body>
</html>
+3 -1
View File
@@ -127,7 +127,9 @@
.catch(() => { localStorage.removeItem('authToken'); window.location.href = '/'; });
}
};
Vue.createApp(UsersApp).mount('#app');
const app = Vue.createApp(UsersApp);
app.use(ElementPlus);
app.mount('#app');
</script>
</body>
</html>