verce-vue-test 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.vscode/extensions.json +3 -0
- package/.vscode/settings.json +8 -0
- package/README.md +42 -0
- package/env.d.ts +1 -0
- package/index.html +13 -0
- package/package.json +50 -0
- package/public/favicon.ico +0 -0
- package/src/App.vue +54 -0
- package/src/assets/logo.svg +1 -0
- package/src/components/ElTablePro.vue +539 -0
- package/src/components/icons/IconCommunity.vue +7 -0
- package/src/components/icons/IconDocumentation.vue +7 -0
- package/src/components/icons/IconEcosystem.vue +7 -0
- package/src/components/icons/IconSupport.vue +7 -0
- package/src/components/icons/IconTooling.vue +19 -0
- package/src/main.ts +15 -0
- package/src/router/index.ts +40 -0
- package/src/stores/counter.ts +12 -0
- package/src/views/AboutView.vue +5 -0
- package/src/views/DashboardView.vue +86 -0
- package/src/views/FormView.vue +97 -0
- package/src/views/HomeView.vue +35 -0
- package/src/views/TableProView.vue +111 -0
- package/src/views/UserView.vue +85 -0
- package/tsconfig.app.json +18 -0
- package/tsconfig.json +11 -0
- package/tsconfig.node.json +27 -0
- package/vite.config.ts +18 -0
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-row :gutter="20">
|
|
3
|
+
<el-col :span="6">
|
|
4
|
+
<el-card shadow="hover">
|
|
5
|
+
<template #header>
|
|
6
|
+
<span>总用户数</span>
|
|
7
|
+
</template>
|
|
8
|
+
<el-text size="large" tag="div" type="primary">1,280</el-text>
|
|
9
|
+
</el-card>
|
|
10
|
+
</el-col>
|
|
11
|
+
<el-col :span="6">
|
|
12
|
+
<el-card shadow="hover">
|
|
13
|
+
<template #header>
|
|
14
|
+
<span>今日访问</span>
|
|
15
|
+
</template>
|
|
16
|
+
<el-text size="large" tag="div" type="primary">5,420</el-text>
|
|
17
|
+
</el-card>
|
|
18
|
+
</el-col>
|
|
19
|
+
<el-col :span="6">
|
|
20
|
+
<el-card shadow="hover">
|
|
21
|
+
<template #header>
|
|
22
|
+
<span>订单总数</span>
|
|
23
|
+
</template>
|
|
24
|
+
<el-text size="large" tag="div" type="primary">836</el-text>
|
|
25
|
+
</el-card>
|
|
26
|
+
</el-col>
|
|
27
|
+
<el-col :span="6">
|
|
28
|
+
<el-card shadow="hover">
|
|
29
|
+
<template #header>
|
|
30
|
+
<span>销售额</span>
|
|
31
|
+
</template>
|
|
32
|
+
<el-text size="large" tag="div" type="primary">¥128,500</el-text>
|
|
33
|
+
</el-card>
|
|
34
|
+
</el-col>
|
|
35
|
+
</el-row>
|
|
36
|
+
|
|
37
|
+
<el-row :gutter="20" style="margin-top: 20px">
|
|
38
|
+
<el-col :span="16">
|
|
39
|
+
<el-card shadow="hover">
|
|
40
|
+
<template #header>
|
|
41
|
+
<span>最近活动</span>
|
|
42
|
+
</template>
|
|
43
|
+
<el-table :data="recentActivities" stripe>
|
|
44
|
+
<el-table-column prop="time" label="时间" width="180" />
|
|
45
|
+
<el-table-column prop="user" label="用户" width="120" />
|
|
46
|
+
<el-table-column prop="action" label="操作" />
|
|
47
|
+
<el-table-column prop="status" label="状态">
|
|
48
|
+
<template #default="{ row }">
|
|
49
|
+
<el-tag :type="row.status === '成功' ? 'success' : row.status === '处理中' ? 'warning' : 'danger'">
|
|
50
|
+
{{ row.status }}
|
|
51
|
+
</el-tag>
|
|
52
|
+
</template>
|
|
53
|
+
</el-table-column>
|
|
54
|
+
</el-table>
|
|
55
|
+
</el-card>
|
|
56
|
+
</el-col>
|
|
57
|
+
<el-col :span="8">
|
|
58
|
+
<el-card shadow="hover">
|
|
59
|
+
<template #header>
|
|
60
|
+
<span>待办事项</span>
|
|
61
|
+
</template>
|
|
62
|
+
<el-timeline>
|
|
63
|
+
<el-timeline-item timestamp="2026-05-13" placement="top">
|
|
64
|
+
审核新用户注册申请
|
|
65
|
+
</el-timeline-item>
|
|
66
|
+
<el-timeline-item timestamp="2026-05-12" placement="top">
|
|
67
|
+
处理退款订单
|
|
68
|
+
</el-timeline-item>
|
|
69
|
+
<el-timeline-item timestamp="2026-05-11" placement="top">
|
|
70
|
+
更新系统配置
|
|
71
|
+
</el-timeline-item>
|
|
72
|
+
</el-timeline>
|
|
73
|
+
</el-card>
|
|
74
|
+
</el-col>
|
|
75
|
+
</el-row>
|
|
76
|
+
</template>
|
|
77
|
+
|
|
78
|
+
<script setup lang="ts">
|
|
79
|
+
const recentActivities = [
|
|
80
|
+
{ time: '2026-05-13 10:30', user: '张三', action: '提交了订单', status: '成功' },
|
|
81
|
+
{ time: '2026-05-13 09:15', user: '李四', action: '修改了个人资料', status: '成功' },
|
|
82
|
+
{ time: '2026-05-12 18:00', user: '王五', action: '发起了退款', status: '处理中' },
|
|
83
|
+
{ time: '2026-05-12 14:22', user: '赵六', action: '删除了评论', status: '失败' },
|
|
84
|
+
{ time: '2026-05-12 11:05', user: '孙七', action: '注册了账号', status: '成功' },
|
|
85
|
+
]
|
|
86
|
+
</script>
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-card shadow="hover">
|
|
3
|
+
<template #header>
|
|
4
|
+
<span>信息录入</span>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<el-form :model="form" :rules="rules" ref="formRef" label-width="100px" style="max-width: 600px">
|
|
8
|
+
<el-form-item label="姓名" prop="name">
|
|
9
|
+
<el-input v-model="form.name" placeholder="请输入姓名" />
|
|
10
|
+
</el-form-item>
|
|
11
|
+
|
|
12
|
+
<el-form-item label="年龄" prop="age">
|
|
13
|
+
<el-input-number v-model="form.age" :min="1" :max="150" />
|
|
14
|
+
</el-form-item>
|
|
15
|
+
|
|
16
|
+
<el-form-item label="性别" prop="gender">
|
|
17
|
+
<el-radio-group v-model="form.gender">
|
|
18
|
+
<el-radio value="male">男</el-radio>
|
|
19
|
+
<el-radio value="female">女</el-radio>
|
|
20
|
+
</el-radio-group>
|
|
21
|
+
</el-form-item>
|
|
22
|
+
|
|
23
|
+
<el-form-item label="生日" prop="birthday">
|
|
24
|
+
<el-date-picker v-model="form.birthday" type="date" placeholder="选择日期" style="width: 100%" />
|
|
25
|
+
</el-form-item>
|
|
26
|
+
|
|
27
|
+
<el-form-item label="城市" prop="city">
|
|
28
|
+
<el-select v-model="form.city" placeholder="请选择城市" style="width: 100%">
|
|
29
|
+
<el-option label="北京" value="beijing" />
|
|
30
|
+
<el-option label="上海" value="shanghai" />
|
|
31
|
+
<el-option label="广州" value="guangzhou" />
|
|
32
|
+
<el-option label="深圳" value="shenzhen" />
|
|
33
|
+
</el-select>
|
|
34
|
+
</el-form-item>
|
|
35
|
+
|
|
36
|
+
<el-form-item label="爱好" prop="hobbies">
|
|
37
|
+
<el-checkbox-group v-model="form.hobbies">
|
|
38
|
+
<el-checkbox value="reading" label="阅读" />
|
|
39
|
+
<el-checkbox value="sports" label="运动" />
|
|
40
|
+
<el-checkbox value="music" label="音乐" />
|
|
41
|
+
<el-checkbox value="travel" label="旅行" />
|
|
42
|
+
</el-checkbox-group>
|
|
43
|
+
</el-form-item>
|
|
44
|
+
|
|
45
|
+
<el-form-item label="评分" prop="rating">
|
|
46
|
+
<el-rate v-model="form.rating" />
|
|
47
|
+
</el-form-item>
|
|
48
|
+
|
|
49
|
+
<el-form-item label="备注" prop="remark">
|
|
50
|
+
<el-input v-model="form.remark" type="textarea" :rows="3" placeholder="请输入备注" />
|
|
51
|
+
</el-form-item>
|
|
52
|
+
|
|
53
|
+
<el-form-item>
|
|
54
|
+
<el-button type="primary" @click="handleSubmit">提交</el-button>
|
|
55
|
+
<el-button @click="handleReset">重置</el-button>
|
|
56
|
+
</el-form-item>
|
|
57
|
+
</el-form>
|
|
58
|
+
</el-card>
|
|
59
|
+
</template>
|
|
60
|
+
|
|
61
|
+
<script setup lang="ts">
|
|
62
|
+
import { ref, reactive } from 'vue'
|
|
63
|
+
import type { FormInstance, FormRules } from 'element-plus'
|
|
64
|
+
import { ElMessage } from 'element-plus'
|
|
65
|
+
|
|
66
|
+
const formRef = ref<FormInstance>()
|
|
67
|
+
|
|
68
|
+
const form = reactive({
|
|
69
|
+
name: '',
|
|
70
|
+
age: 18,
|
|
71
|
+
gender: '',
|
|
72
|
+
birthday: '',
|
|
73
|
+
city: '',
|
|
74
|
+
hobbies: [] as string[],
|
|
75
|
+
rating: 0,
|
|
76
|
+
remark: '',
|
|
77
|
+
})
|
|
78
|
+
|
|
79
|
+
const rules = reactive<FormRules>({
|
|
80
|
+
name: [{ required: true, message: '请输入姓名', trigger: 'blur' }],
|
|
81
|
+
gender: [{ required: true, message: '请选择性别', trigger: 'change' }],
|
|
82
|
+
city: [{ required: true, message: '请选择城市', trigger: 'change' }],
|
|
83
|
+
})
|
|
84
|
+
|
|
85
|
+
const handleSubmit = async () => {
|
|
86
|
+
if (!formRef.value) return
|
|
87
|
+
await formRef.value.validate((valid) => {
|
|
88
|
+
if (valid) {
|
|
89
|
+
ElMessage.success('提交成功!')
|
|
90
|
+
}
|
|
91
|
+
})
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
const handleReset = () => {
|
|
95
|
+
formRef.value?.resetFields()
|
|
96
|
+
}
|
|
97
|
+
</script>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-card shadow="hover">
|
|
3
|
+
<template #header>
|
|
4
|
+
<el-text tag="h1" size="large">欢迎使用管理系统</el-text>
|
|
5
|
+
</template>
|
|
6
|
+
<el-text>基于 Vue 3 + Element Plus 构建的管理系统模板</el-text>
|
|
7
|
+
</el-card>
|
|
8
|
+
|
|
9
|
+
<el-row :gutter="20" style="margin-top: 20px">
|
|
10
|
+
<el-col :span="8">
|
|
11
|
+
<el-card shadow="hover">
|
|
12
|
+
<template #header>
|
|
13
|
+
<el-text tag="h3">Vue 3</el-text>
|
|
14
|
+
</template>
|
|
15
|
+
<el-text>渐进式 JavaScript 框架</el-text>
|
|
16
|
+
</el-card>
|
|
17
|
+
</el-col>
|
|
18
|
+
<el-col :span="8">
|
|
19
|
+
<el-card shadow="hover">
|
|
20
|
+
<template #header>
|
|
21
|
+
<el-text tag="h3">Element Plus</el-text>
|
|
22
|
+
</template>
|
|
23
|
+
<el-text>基于 Vue 3 的组件库</el-text>
|
|
24
|
+
</el-card>
|
|
25
|
+
</el-col>
|
|
26
|
+
<el-col :span="8">
|
|
27
|
+
<el-card shadow="hover">
|
|
28
|
+
<template #header>
|
|
29
|
+
<el-text tag="h3">Vite</el-text>
|
|
30
|
+
</template>
|
|
31
|
+
<el-text>下一代前端构建工具</el-text>
|
|
32
|
+
</el-card>
|
|
33
|
+
</el-col>
|
|
34
|
+
</el-row>
|
|
35
|
+
</template>
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ElTablePro
|
|
3
|
+
:data="tableData"
|
|
4
|
+
:total="total"
|
|
5
|
+
v-model:page="query.page"
|
|
6
|
+
v-model:page-size="query.pageSize"
|
|
7
|
+
table-key="user"
|
|
8
|
+
row-key="id"
|
|
9
|
+
border
|
|
10
|
+
stripe
|
|
11
|
+
v-loading="loading"
|
|
12
|
+
@pagination-change="handlePaginationChange"
|
|
13
|
+
>
|
|
14
|
+
<template #toolbar>
|
|
15
|
+
<el-button type="primary" @click="handleAdd">新增</el-button>
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<el-table-column type="index" label="序号" width="80" />
|
|
19
|
+
<el-table-column prop="name" label="姓名" />
|
|
20
|
+
<el-table-column prop="age" label="年龄" width="80" />
|
|
21
|
+
<el-table-column prop="email" label="邮箱" />
|
|
22
|
+
<el-table-column prop="role" label="角色" width="120">
|
|
23
|
+
<template #default="{ row }">
|
|
24
|
+
<el-tag :type="row.role === '管理员' ? 'danger' : row.role === '编辑' ? 'warning' : 'info'">
|
|
25
|
+
{{ row.role }}
|
|
26
|
+
</el-tag>
|
|
27
|
+
</template>
|
|
28
|
+
</el-table-column>
|
|
29
|
+
<el-table-column prop="status" label="状态" width="100">
|
|
30
|
+
<template #default="{ row }">
|
|
31
|
+
<el-tag :type="row.status ? 'success' : 'danger'">
|
|
32
|
+
{{ row.status ? '启用' : '禁用' }}
|
|
33
|
+
</el-tag>
|
|
34
|
+
</template>
|
|
35
|
+
</el-table-column>
|
|
36
|
+
<el-table-column label="操作" width="180">
|
|
37
|
+
<template #default="{ row }">
|
|
38
|
+
<el-button link type="primary" @click="handleEdit(row)">编辑</el-button>
|
|
39
|
+
<el-button link type="danger" @click="handleDelete(row)">删除</el-button>
|
|
40
|
+
</template>
|
|
41
|
+
</el-table-column>
|
|
42
|
+
</ElTablePro>
|
|
43
|
+
</template>
|
|
44
|
+
|
|
45
|
+
<script setup lang="ts">
|
|
46
|
+
import { ref, reactive, onMounted } from 'vue'
|
|
47
|
+
import { ElMessage, ElMessageBox } from 'element-plus'
|
|
48
|
+
import ElTablePro from '@/components/ElTablePro.vue'
|
|
49
|
+
|
|
50
|
+
const loading = ref(false)
|
|
51
|
+
const total = ref(0)
|
|
52
|
+
|
|
53
|
+
const query = reactive({
|
|
54
|
+
page: 1,
|
|
55
|
+
pageSize: 10,
|
|
56
|
+
})
|
|
57
|
+
|
|
58
|
+
const allData = [
|
|
59
|
+
{ id: 1, name: '张三', age: 28, email: 'zhangsan@example.com', role: '管理员', status: true },
|
|
60
|
+
{ id: 2, name: '李四', age: 32, email: 'lisi@example.com', role: '编辑', status: true },
|
|
61
|
+
{ id: 3, name: '王五', age: 25, email: 'wangwu@example.com', role: '用户', status: false },
|
|
62
|
+
{ id: 4, name: '赵六', age: 29, email: 'zhaoliu@example.com', role: '用户', status: true },
|
|
63
|
+
{ id: 5, name: '孙七', age: 35, email: 'sunqi@example.com', role: '编辑', status: true },
|
|
64
|
+
{ id: 6, name: '周八', age: 27, email: 'zhouba@example.com', role: '用户', status: true },
|
|
65
|
+
{ id: 7, name: '吴九', age: 31, email: 'wujiu@example.com', role: '管理员', status: true },
|
|
66
|
+
{ id: 8, name: '郑十', age: 24, email: 'zhengshi@example.com', role: '用户', status: false },
|
|
67
|
+
{ id: 9, name: '刘一', age: 33, email: 'liuyi@example.com', role: '编辑', status: true },
|
|
68
|
+
{ id: 10, name: '陈二', age: 26, email: 'chener@example.com', role: '用户', status: true },
|
|
69
|
+
{ id: 11, name: '杨三', age: 30, email: 'yangsan@example.com', role: '用户', status: true },
|
|
70
|
+
{ id: 12, name: '黄四', age: 28, email: 'huangsi@example.com', role: '编辑', status: false },
|
|
71
|
+
]
|
|
72
|
+
|
|
73
|
+
const tableData = ref<any[]>([])
|
|
74
|
+
|
|
75
|
+
const getList = () => {
|
|
76
|
+
loading.value = true
|
|
77
|
+
setTimeout(() => {
|
|
78
|
+
const start = (query.page - 1) * query.pageSize
|
|
79
|
+
const end = start + query.pageSize
|
|
80
|
+
tableData.value = allData.slice(start, end)
|
|
81
|
+
total.value = allData.length
|
|
82
|
+
loading.value = false
|
|
83
|
+
}, 300)
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
const handlePaginationChange = (_value: { page: number; pageSize: number }) => {
|
|
87
|
+
getList()
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const handleAdd = () => {
|
|
91
|
+
ElMessage.info('新增用户')
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
const handleEdit = (row: any) => {
|
|
95
|
+
ElMessage.info(`编辑用户: ${row.name}`)
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
const handleDelete = (row: any) => {
|
|
99
|
+
ElMessageBox.confirm(`确认删除用户 ${row.name}?`, '提示', {
|
|
100
|
+
confirmButtonText: '确认',
|
|
101
|
+
cancelButtonText: '取消',
|
|
102
|
+
type: 'warning',
|
|
103
|
+
}).then(() => {
|
|
104
|
+
ElMessage.success('删除成功')
|
|
105
|
+
}).catch(() => {})
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
onMounted(() => {
|
|
109
|
+
getList()
|
|
110
|
+
})
|
|
111
|
+
</script>
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-card shadow="hover">
|
|
3
|
+
<template #header>
|
|
4
|
+
<el-row justify="space-between" align="middle">
|
|
5
|
+
<el-text tag="span" size="large">用户管理</el-text>
|
|
6
|
+
<el-button type="primary" @click="dialogVisible = true">新增用户</el-button>
|
|
7
|
+
</el-row>
|
|
8
|
+
</template>
|
|
9
|
+
|
|
10
|
+
<el-table :data="users" stripe>
|
|
11
|
+
<el-table-column prop="id" label="ID" width="80" />
|
|
12
|
+
<el-table-column prop="name" label="姓名" width="120" />
|
|
13
|
+
<el-table-column prop="email" label="邮箱" />
|
|
14
|
+
<el-table-column prop="role" label="角色" width="120">
|
|
15
|
+
<template #default="{ row }">
|
|
16
|
+
<el-tag :type="row.role === '管理员' ? 'danger' : row.role === '编辑' ? 'warning' : 'info'">
|
|
17
|
+
{{ row.role }}
|
|
18
|
+
</el-tag>
|
|
19
|
+
</template>
|
|
20
|
+
</el-table-column>
|
|
21
|
+
<el-table-column prop="status" label="状态" width="100">
|
|
22
|
+
<template #default="{ row }">
|
|
23
|
+
<el-switch v-model="row.status" />
|
|
24
|
+
</template>
|
|
25
|
+
</el-table-column>
|
|
26
|
+
<el-table-column label="操作" width="180">
|
|
27
|
+
<template #default>
|
|
28
|
+
<el-button size="small" type="primary" link>编辑</el-button>
|
|
29
|
+
<el-button size="small" type="danger" link>删除</el-button>
|
|
30
|
+
</template>
|
|
31
|
+
</el-table-column>
|
|
32
|
+
</el-table>
|
|
33
|
+
|
|
34
|
+
<el-row justify="end" style="margin-top: 20px">
|
|
35
|
+
<el-pagination
|
|
36
|
+
background
|
|
37
|
+
layout="prev, pager, next"
|
|
38
|
+
:total="100"
|
|
39
|
+
:page-size="10"
|
|
40
|
+
/>
|
|
41
|
+
</el-row>
|
|
42
|
+
</el-card>
|
|
43
|
+
|
|
44
|
+
<el-dialog v-model="dialogVisible" title="新增用户" width="500px">
|
|
45
|
+
<el-form :model="form" label-width="80px">
|
|
46
|
+
<el-form-item label="姓名">
|
|
47
|
+
<el-input v-model="form.name" placeholder="请输入姓名" />
|
|
48
|
+
</el-form-item>
|
|
49
|
+
<el-form-item label="邮箱">
|
|
50
|
+
<el-input v-model="form.email" placeholder="请输入邮箱" />
|
|
51
|
+
</el-form-item>
|
|
52
|
+
<el-form-item label="角色">
|
|
53
|
+
<el-select v-model="form.role" placeholder="请选择角色" style="width: 100%">
|
|
54
|
+
<el-option label="管理员" value="管理员" />
|
|
55
|
+
<el-option label="编辑" value="编辑" />
|
|
56
|
+
<el-option label="用户" value="用户" />
|
|
57
|
+
</el-select>
|
|
58
|
+
</el-form-item>
|
|
59
|
+
</el-form>
|
|
60
|
+
<template #footer>
|
|
61
|
+
<el-button @click="dialogVisible = false">取消</el-button>
|
|
62
|
+
<el-button type="primary" @click="dialogVisible = false">确认</el-button>
|
|
63
|
+
</template>
|
|
64
|
+
</el-dialog>
|
|
65
|
+
</template>
|
|
66
|
+
|
|
67
|
+
<script setup lang="ts">
|
|
68
|
+
import { ref, reactive } from 'vue'
|
|
69
|
+
|
|
70
|
+
const dialogVisible = ref(false)
|
|
71
|
+
|
|
72
|
+
const form = reactive({
|
|
73
|
+
name: '',
|
|
74
|
+
email: '',
|
|
75
|
+
role: '',
|
|
76
|
+
})
|
|
77
|
+
|
|
78
|
+
const users = ref([
|
|
79
|
+
{ id: 1, name: '张三', email: 'zhangsan@example.com', role: '管理员', status: true },
|
|
80
|
+
{ id: 2, name: '李四', email: 'lisi@example.com', role: '编辑', status: true },
|
|
81
|
+
{ id: 3, name: '王五', email: 'wangwu@example.com', role: '用户', status: false },
|
|
82
|
+
{ id: 4, name: '赵六', email: 'zhaoliu@example.com', role: '用户', status: true },
|
|
83
|
+
{ id: 5, name: '孙七', email: 'sunqi@example.com', role: '编辑', status: true },
|
|
84
|
+
])
|
|
85
|
+
</script>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "@vue/tsconfig/tsconfig.dom.json",
|
|
3
|
+
"include": ["env.d.ts", "src/**/*", "src/**/*.vue"],
|
|
4
|
+
"exclude": ["src/**/__tests__/*"],
|
|
5
|
+
"compilerOptions": {
|
|
6
|
+
// Extra safety for array and object lookups, but may have false positives.
|
|
7
|
+
"noUncheckedIndexedAccess": true,
|
|
8
|
+
|
|
9
|
+
// Path mapping for cleaner imports.
|
|
10
|
+
"paths": {
|
|
11
|
+
"@/*": ["./src/*"]
|
|
12
|
+
},
|
|
13
|
+
|
|
14
|
+
// `vue-tsc --build` produces a .tsbuildinfo file for incremental type-checking.
|
|
15
|
+
// Specified here to keep it out of the root directory.
|
|
16
|
+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo"
|
|
17
|
+
}
|
|
18
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// TSConfig for modules that run in Node.js environment via either transpilation or type-stripping.
|
|
2
|
+
{
|
|
3
|
+
"extends": "@tsconfig/node24/tsconfig.json",
|
|
4
|
+
"include": [
|
|
5
|
+
"vite.config.*",
|
|
6
|
+
"vitest.config.*",
|
|
7
|
+
"cypress.config.*",
|
|
8
|
+
"playwright.config.*",
|
|
9
|
+
"eslint.config.*"
|
|
10
|
+
],
|
|
11
|
+
"compilerOptions": {
|
|
12
|
+
// Most tools use transpilation instead of Node.js's native type-stripping.
|
|
13
|
+
// Bundler mode provides a smoother developer experience.
|
|
14
|
+
"module": "preserve",
|
|
15
|
+
"moduleResolution": "bundler",
|
|
16
|
+
|
|
17
|
+
// Include Node.js types and avoid accidentally including other `@types/*` packages.
|
|
18
|
+
"types": ["node"],
|
|
19
|
+
|
|
20
|
+
// Disable emitting output during `vue-tsc --build`, which is used for type-checking only.
|
|
21
|
+
"noEmit": true,
|
|
22
|
+
|
|
23
|
+
// `vue-tsc --build` produces a .tsbuildinfo file for incremental type-checking.
|
|
24
|
+
// Specified here to keep it out of the root directory.
|
|
25
|
+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo"
|
|
26
|
+
}
|
|
27
|
+
}
|
package/vite.config.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { fileURLToPath, URL } from 'node:url'
|
|
2
|
+
|
|
3
|
+
import { defineConfig } from 'vite'
|
|
4
|
+
import vue from '@vitejs/plugin-vue'
|
|
5
|
+
import vueDevTools from 'vite-plugin-vue-devtools'
|
|
6
|
+
|
|
7
|
+
// https://vite.dev/config/
|
|
8
|
+
export default defineConfig({
|
|
9
|
+
plugins: [
|
|
10
|
+
vue(),
|
|
11
|
+
vueDevTools(),
|
|
12
|
+
],
|
|
13
|
+
resolve: {
|
|
14
|
+
alias: {
|
|
15
|
+
'@': fileURLToPath(new URL('./src', import.meta.url))
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
})
|