5fe426fc90
- 本地化所有资源 (Vue3, Element Plus) 无需外部 CDN - 重新设计主页:登录页 + 系统概览 + 侧边栏导航 - 完善管理后台功能:选题管理、系统日志、用户管理 - 全面支持 PC 和 H5 移动端(响应式布局 + 底部导航) - 优化后端 API 返回格式,兼容前端需求 - 默认首页为登录/系统概览页面 - 统计卡片可点击筛选选题列表 - 模块状态实时展示
97 lines
3.2 KiB
HTML
97 lines
3.2 KiB
HTML
|
|
<!DOCTYPE html>
|
|
<html lang="zh-CN">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Vue最简单测试</title>
|
|
<script src="https://cdn.tailwindcss.com"></script>
|
|
<script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
|
|
|
|
<style>
|
|
body { font-family: Arial, sans-serif; padding: 20px; }
|
|
.test-result { margin: 10px 0; padding: 10px; border-radius: 4px; }
|
|
.success { background-color: #d4edda; color: #155724; }
|
|
.error { background-color: #f8d7da; color: #721c24; }
|
|
.info { background-color: #d1ecf1; color: #0c5460; }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div id="app">
|
|
<h1>{{ title }}</h1>
|
|
|
|
<!-- 基础功能测试 -->
|
|
<div class="test-result info">
|
|
<strong>基础测试:</strong>
|
|
<p>当前计数: {{ count }}</p>
|
|
<button @click="count++">增加计数</button>
|
|
</div>
|
|
|
|
<!-- Vue初始化状态 -->
|
|
<div class="test-result" :class="{'success': vueReady, 'error': !vueReady}">
|
|
<strong>Vue状态:</strong>
|
|
<p v-if="vueReady">✅ Vue已就绪</p>
|
|
<p v-if="!vueReady">❌ Vue未就绪</p>
|
|
</div>
|
|
|
|
<!-- 调试信息 -->
|
|
<div class="test-result info">
|
|
<strong>调试信息:</strong>
|
|
<ul>
|
|
<li v-for="log in debugLogs" :key="log">{{ log }}</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
const SimpleApp = {
|
|
data() {
|
|
return {
|
|
title: "Vue最简测试",
|
|
count: 0,
|
|
vueReady: false,
|
|
debugLogs: []
|
|
}
|
|
},
|
|
methods: {
|
|
addLog(message) {
|
|
this.debugLogs.push('[' + new Date().toLocaleTimeString() + '] ' + message);
|
|
}
|
|
},
|
|
mounted() {
|
|
this.addLog('Vue应用已启动');
|
|
|
|
// 检查Vue是否正确初始化
|
|
try {
|
|
console.log('Vue实例:', this);
|
|
console.log('数据对象:', this.$data);
|
|
|
|
// 测试基本响应式
|
|
setTimeout(() => {
|
|
this.vueReady = true;
|
|
this.addLog('✅ Vue响应式系统正常工作');
|
|
|
|
// 测试事件处理
|
|
this.addLog('✅ 事件监听器已设置');
|
|
|
|
// 测试数据绑定
|
|
this.addLog('✅ 文本插值正常工作');
|
|
}, 100);
|
|
|
|
} catch (error) {
|
|
this.vueReady = false;
|
|
this.addLog('❌ Vue初始化失败: ' + error.message);
|
|
}
|
|
}
|
|
}
|
|
|
|
try {
|
|
Vue.createApp(SimpleApp).mount('#app');
|
|
console.log('Vue应用程序已成功创建和挂载');
|
|
} catch (error) {
|
|
console.error('Vue应用程序创建失败:', error);
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>
|