Skip to content

Commit ea95451

Browse files
committed
Initial commit
1 parent c31048f commit ea95451

File tree

13 files changed

+829
-0
lines changed

13 files changed

+829
-0
lines changed

.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?

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
# vue3-vant-mobile
2+
23
🔥🔥🔥 基于Vue3、TypeScript、Vite、Pinia、Vant3 构建的移动APP基础架子

index.html

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<!DOCTYPE html>
2+
<html lang="zh-cmn-Hans">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" href="/favicon.ico" />
6+
<meta
7+
name="viewport"
8+
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, viewport-fit=cover"
9+
/>
10+
<title>Vue3 Vant Mobile</title>
11+
</head>
12+
<body>
13+
<div id="app"></div>
14+
<script type="module" src="/src/main.ts"></script>
15+
</body>
16+
</html>

package.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"name": "vue3-vant-mobile",
3+
"private": true,
4+
"version": "0.0.0",
5+
"scripts": {
6+
"dev": "vite",
7+
"build": "vue-tsc --noEmit && vite build",
8+
"preview": "vite preview"
9+
},
10+
"dependencies": {
11+
"@vant/touch-emulator": "^1.3.2",
12+
"pinia": "^2.0.14",
13+
"vant": "^3.4.9",
14+
"vue": "^3.2.25"
15+
},
16+
"devDependencies": {
17+
"@vitejs/plugin-vue": "^2.3.3",
18+
"typescript": "^4.5.4",
19+
"vite": "^2.9.9",
20+
"vite-plugin-style-import": "1.4.1",
21+
"vue-tsc": "^0.34.7"
22+
}
23+
}

public/favicon.ico

4.19 KB
Binary file not shown.

src/App.vue

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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+
<img alt="Vue logo" src="./assets/logo.png" />
9+
<HelloWorld msg="Hello Vue 3 + TypeScript + Vite" />
10+
</template>
11+
12+
<style>
13+
#app {
14+
font-family: Avenir, Helvetica, Arial, sans-serif;
15+
-webkit-font-smoothing: antialiased;
16+
-moz-osx-font-smoothing: grayscale;
17+
text-align: center;
18+
color: #2c3e50;
19+
margin-top: 60px;
20+
}
21+
</style>

src/assets/logo.png

6.69 KB
Loading

src/components/HelloWorld.vue

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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+
<van-button type="primary" @click="count++">count is: {{ count }}</van-button>
12+
</template>
13+
14+
<style scoped>
15+
a {
16+
color: #42b983;
17+
}
18+
19+
label {
20+
margin: 0 0.5em;
21+
font-weight: bold;
22+
}
23+
24+
code {
25+
background-color: #eee;
26+
padding: 2px 4px;
27+
border-radius: 4px;
28+
color: #304455;
29+
}
30+
</style>

src/env.d.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/// <reference types="vite/client" />
2+
3+
declare module '*.vue' {
4+
import type { DefineComponent } from 'vue'
5+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
6+
const component: DefineComponent<{}, {}, any>
7+
export default component
8+
}

src/main.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { createApp } from 'vue'
2+
import App from './App.vue'
3+
import { createPinia } from 'pinia'
4+
import { Button } from 'vant'
5+
6+
// Vant 桌面端适配
7+
import '@vant/touch-emulator'
8+
9+
10+
createApp(App)
11+
.use(createPinia())
12+
.use(Button)
13+
.mount('#app')

0 commit comments

Comments
 (0)