Skip to content

Commit eb094a8

Browse files
authored
chore: depend on upgrade (#41)
* style: 🎨 optimized code * test: add example test * test: uniapp example * chore: depend on upgrade
1 parent 51710cc commit eb094a8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+1099
-572
lines changed

commitlint.config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@
99
// ci:主要目的是修改项目继续集成流程(例如 Travis,Jenkins,GitLab CI,Circle等)的提交 | The main purpose is to modify the submission of project continued integration processes (e. g. Travis, Jenkins, GitLab CI, Circle, etc.)
1010
// chore:不属于以上类型的其他类,比如构建流程, 依赖管理 | Other classes that do not belong to the above types, such as building processes, dependency management
1111
// revert:回滚某个更早之前的提交 | Roll back some earlier previous submission
12+
// workflow: 工作流 | workflow
1213
// version: 改变package.json 版本 | Change the package.json version
1314

1415
module.exports = {
15-
ignores: [(commit) => commit.includes('init')],
16+
ignores: [commit => commit.includes('init')],
1617
extends: ['@commitlint/config-conventional'],
1718
rules: {
1819
'body-leading-blank': [2, 'always'],
@@ -36,11 +37,10 @@ module.exports = {
3637
'ci',
3738
'chore',
3839
'revert',
39-
'wip',
4040
'workflow',
4141
'types',
4242
'release',
43-
'version'
43+
'version',
4444
],
4545
],
4646
},

example/h5/.gitignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?

example/h5/.vscode/extensions.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"recommendations": ["Vue.volar"]
3+
}

example/h5/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Vue 3 + TypeScript + Vite
2+
3+
This template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.
4+
5+
## Recommended IDE Setup
6+
7+
- [VS Code](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar)
8+
9+
## Type Support For `.vue` Imports in TS
10+
11+
Since TypeScript cannot handle type information for `.vue` imports, they are shimmed to be a generic Vue component type by default. In most cases this is fine if you don't really care about component prop types outside of templates. However, if you wish to get actual prop types in `.vue` imports (for example to get props validation when using manual `h(...)` calls), you can enable Volar's Take Over mode by following these steps:
12+
13+
1. Run `Extensions: Show Built-in Extensions` from VS Code's command palette, look for `TypeScript and JavaScript Language Features`, then right click and select `Disable (Workspace)`. By default, Take Over mode will enable itself if the default TypeScript extension is disabled.
14+
2. Reload the VS Code window by running `Developer: Reload Window` from the command palette.
15+
16+
You can learn more about Take Over mode [here](https://github.com/johnsoncodehk/volar/discussions/471).

example/h5/index.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>Vite + Vue + TS</title>
8+
</head>
9+
<body>
10+
<div id="app"></div>
11+
<script type="module" src="/src/main.ts"></script>
12+
</body>
13+
</html>

example/h5/package.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"name": "h5",
3+
"private": true,
4+
"version": "0.0.0",
5+
"type": "module",
6+
"scripts": {
7+
"dev": "vite",
8+
"build": "vue-tsc && vite build",
9+
"preview": "vite preview"
10+
},
11+
"dependencies": {
12+
"vue": "^3.2.41"
13+
},
14+
"devDependencies": {
15+
"@vitejs/plugin-vue": "^3.2.0",
16+
"typescript": "^4.6.4",
17+
"vite": "^3.2.3",
18+
"vue-tsc": "^1.0.9"
19+
}
20+
}

example/h5/public/vite.svg

Lines changed: 1 addition & 0 deletions
Loading

example/h5/src/App.vue

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<script setup lang="ts">
2+
// This starter template is using Vue 3 <script setup> SFCs
3+
// Check out https://vuejs.org/api/sfc-script-setup.html#script-setup
4+
import HelloWorld from './components/HelloWorld.vue'
5+
</script>
6+
7+
<template>
8+
<div>
9+
<a href="https://vitejs.dev" target="_blank">
10+
<img src="/vite.svg" class="logo" alt="Vite logo">
11+
</a>
12+
<a href="https://vuejs.org/" target="_blank">
13+
<img src="./assets/vue.svg" class="logo vue" alt="Vue logo">
14+
</a>
15+
</div>
16+
<HelloWorld msg="Vite + Vue" />
17+
</template>
18+
19+
<style scoped>
20+
.logo {
21+
height: 6em;
22+
padding: 1.5em;
23+
will-change: filter;
24+
}
25+
.logo:hover {
26+
filter: drop-shadow(0 0 2em #646cffaa);
27+
}
28+
.logo.vue:hover {
29+
filter: drop-shadow(0 0 2em #42b883aa);
30+
}
31+
</style>

example/h5/src/assets/vue.svg

Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<script setup lang="ts">
2+
import { ref } from 'vue'
3+
4+
defineProps<{ msg: string }>()
5+
6+
const count = ref(0)
7+
</script>
8+
9+
<template>
10+
<h1>{{ msg }}</h1>
11+
12+
<div class="card">
13+
<button type="button" @click="count++">count is {{ count }}</button>
14+
<p>
15+
Edit
16+
<code>components/HelloWorld.vue</code> to test HMR
17+
</p>
18+
</div>
19+
20+
<p>
21+
Check out
22+
<a href="https://vuejs.org/guide/quick-start.html#local" target="_blank"
23+
>create-vue</a
24+
>, the official Vue + Vite starter
25+
</p>
26+
<p>
27+
Install
28+
<a href="https://github.com/johnsoncodehk/volar" target="_blank">Volar</a>
29+
in your IDE for a better DX
30+
</p>
31+
<p class="read-the-docs">Click on the Vite and Vue logos to learn more</p>
32+
</template>
33+
34+
<style scoped>
35+
.read-the-docs {
36+
color: #888;
37+
}
38+
</style>

0 commit comments

Comments
 (0)