Skip to content

Commit 4f90357

Browse files
committed
chore: 删除pug
1 parent cbd5272 commit 4f90357

15 files changed

+145
-660
lines changed

README.md

+8-9
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1-
# vue3-vant3-h5-template-ts [![Build Status](https://travis-ci.org/quliangen/vue3-vant3-h5-template-ts.svg?branch=master)](https://travis-ci.org/quliangen/vue3-vant3-h5-template-ts)
1+
# vue3-vant4-h5-template-ts [![Build Status](https://travis-ci.org/quliangen/vue3-vant3-h5-template-ts.svg?branch=master)](https://travis-ci.org/quliangen/vue3-vant3-h5-template-ts)
22
### 预览地址(h5项目请自行f12):https://quliangen.github.io/vue3-vant3-h5-template-ts/
33
## Features:
44
1. vue3 + vue-router4 + pinia
5-
2. vant-ui3(按需import组件)
5+
2. vant-ui4(按需import组件)
66
3. axios(0.20.0) + 封装示例 + devServer配置示例
7-
4. pug
8-
5. less
9-
6. h5 px 2 viewPort
10-
7. eslint + prettier (风格校验 + 一键修复)
11-
8. travis CI push代码自行构建gh-pages
12-
9. 页面demo:基于vant-demo/base 购物车及详情页
13-
10. 集成:[plop](https://plopjs.com/documentation/)
7+
4. less
8+
5. h5 px 2 viewPort
9+
6. eslint + prettier (风格校验 + 一键修复)
10+
7. travis CI push代码自行构建gh-pages
11+
8. 页面demo:基于vant-demo/base 购物车及详情页(已删除)
12+
9. 集成:[plop](https://plopjs.com/documentation/)
1413

1514

1615
## RoadMap:

components.d.ts

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
// generated by unplugin-vue-components
22
// We suggest you to commit this file into source control
33
// Read more: https://github.com/vuejs/core/pull/3399
4-
import '@vue/runtime-core';
4+
import '@vue/runtime-core'
55

6-
export {};
6+
export {}
77

88
declare module '@vue/runtime-core' {
99
export interface GlobalComponents {
10-
HelloWorld: typeof import('./src/components/HelloWorld.vue')['default'];
11-
RouterLink: typeof import('vue-router')['RouterLink'];
12-
RouterView: typeof import('vue-router')['RouterView'];
10+
HelloWorld: typeof import('./src/components/HelloWorld.vue')['default']
11+
RouterLink: typeof import('vue-router')['RouterLink']
12+
RouterView: typeof import('vue-router')['RouterView']
13+
VanButton: typeof import('vant/es')['Button']
1314
}
1415
}

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747
"ts-jest": "^27.0.4",
4848
"typescript": "~4.5.5",
4949
"unplugin-vue-components": "^0.22.11",
50-
"vue-cli-plugin-pug": "~2.0.0",
5150
"vue-jest": "^5.0.0-0",
5251
"yorkie": "^2.0.0"
5352
},
+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<template>
2+
<div class="hello">
3+
<h1>{{ msg }}</h1>
4+
<p>
5+
| Vue3 + Pinia + Vant4 + ViewPort + TS
6+
<br />
7+
组件多 v-model 示例:
8+
<br />
9+
v-model title
10+
<input type="text" :value="title" @input="emits('update:title', $event.target?.value)" />
11+
<br />
12+
v-model name
13+
<input type="text" :value="name" @input="emits('update:name', $event.target?.value)" />
14+
</p>
15+
</div>
16+
</template>
17+
18+
<script lang="ts" setup>
19+
import { defineProps, defineEmits } from 'vue';
20+
defineProps(['msg', 'title', 'name']);
21+
const emits = defineEmits(['update:title', 'update:name']);
22+
</script>
23+
24+
<!-- Add "scoped" attribute to limit CSS to this component only -->
25+
<style scoped lang="less">
26+
h3 {
27+
margin: 40px 0 0;
28+
}
29+
ul {
30+
list-style-type: none;
31+
padding: 0;
32+
}
33+
li {
34+
display: inline-block;
35+
margin: 0 10px;
36+
}
37+
a {
38+
color: #42b983;
39+
}
40+
</style>

plop/templates/components/component.js.hbs

-39
This file was deleted.

plop/templates/views/about.hbs

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<template>
2+
<section class="about">
3+
<h1>This is an about page</h1>
4+
<div>
5+
<span> Pinia demo 来自Home的count </span>
6+
<Button type="danger" size="mini" @click="countAdd"> count++ {{ count }} </Button>
7+
</div>
8+
<div>
9+
<span>route 参数信息:{{ route.params }}</span>
10+
</div>
11+
</section>
12+
</template>
13+
14+
<script lang="ts" setup>
15+
import { Button } from 'vant';
16+
import { onMounted, toRefs } from 'vue';
17+
import { useCount } from '@/stores/useCount';
18+
import { useRoute } from 'vue-router';
19+
import { login } from '@/api/index';
20+
21+
const { count, countAdd } = toRefs(useCount());
22+
const route = useRoute();
23+
console.log('Router with Composition API demo: ', route);
24+
// 详见文档:https://next.router.vuejs.org/guide/advanced/composition-api.html#accessing-the-router-and-current-route-inside-setup
25+
26+
onMounted(() => {
27+
// axios请求demo:
28+
login({
29+
name: 'admin',
30+
password: '123456',
31+
}).then();
32+
});
33+
</script>
34+
35+
<style scoped></style>

plop/templates/views/goods-page.js.hbs

-114
This file was deleted.

0 commit comments

Comments
 (0)