|
1 | | -# Vue 3 + Typescript + Vite |
| 1 | +### 简介 |
2 | 2 |
|
3 | | -This template should help get you started developing with Vue 3 and Typescript in Vite. |
| 3 | +此项目是基于 Vue3.0 全家桶 + TypeScript + Antd2.0 + Vite 搭建简易脚手架,用到大多数常用的 API,适合 Vue3 入门新手借鉴。 |
| 4 | +由于每个项目呈现内容不同,所以在这里我就只搭建了一个骨架,具体内容自定义。 |
4 | 5 |
|
5 | | -## Recommended IDE Setup |
| 6 | +Vue2.0 版本:<a href="https://github.com/sunshine824/vue-typescript-starter.git">https://github.com/sunshine824/vue-typescript-starter.git</a> |
6 | 7 |
|
7 | | -[VSCode](https://code.visualstudio.com/) + [Vetur](https://marketplace.visualstudio.com/items?itemName=octref.vetur). Make sure to enable `vetur.experimental.templateInterpolationService` in settings! |
| 8 | +### 相关包版本号 |
8 | 9 |
|
9 | | -### If Using `<script setup>` |
| 10 | +所有技术都是当前最新的。 |
10 | 11 |
|
11 | | -[`<script setup>`](https://github.com/vuejs/rfcs/pull/227) is a feature that is currently in RFC stage. To get proper IDE support for the syntax, use [Volar](https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.volar) instead of Vetur (and disable Vetur). |
| 12 | +- vue: "^3.0.5", |
| 13 | +- typescript : "^4.3.2", |
| 14 | +- ant-design-vue: "2.2.2", |
| 15 | +- vue-router : "^4.0.9", |
| 16 | +- less:"^4.1.1", |
| 17 | +- vuex: "^4.0.1" |
| 18 | +- axios:"^0.21.1", |
12 | 19 |
|
13 | | -## Type Support For `.vue` Imports in TS |
| 20 | +### Build Setup |
14 | 21 |
|
15 | | -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 use the following: |
| 22 | +``` |
| 23 | +# clone |
| 24 | +git clone https://github.com/sunshine824/vue3.0-typescript-starter.git |
| 25 | +``` |
16 | 26 |
|
17 | | -### If Using Volar |
| 27 | +``` |
| 28 | +# cd |
| 29 | +cd vue3.0-typescript-starter |
| 30 | +``` |
18 | 31 |
|
19 | | -Run `Volar: Switch TS Plugin on/off` from VSCode command palette. |
| 32 | +``` |
| 33 | +# install dependencies |
| 34 | +npm install |
| 35 | +``` |
20 | 36 |
|
21 | | -### If Using Vetur |
| 37 | +``` |
| 38 | +# Compiles and hot-reloads for development |
| 39 | +npm run dev |
| 40 | +``` |
22 | 41 |
|
23 | | -1. Install and add `@vuedx/typescript-plugin-vue` to the [plugins section](https://www.typescriptlang.org/tsconfig#plugins) in `tsconfig.json` |
24 | | -2. Delete `src/shims-vue.d.ts` as it is no longer needed to provide module info to Typescript |
25 | | -3. Open `src/main.ts` in VSCode |
26 | | -4. Open the VSCode command palette |
27 | | -5. Search and run "Select TypeScript version" -> "Use workspace version" |
| 42 | +``` |
| 43 | +# Compiles and minifies for production |
| 44 | +npm run build |
| 45 | +``` |
| 46 | + |
| 47 | +### 最后 |
| 48 | + |
| 49 | +如果你觉得该项目不错,或者对你有所帮助,点个 Star 、或者真心赞赏一下 都是对我最大的鼓励,我会更有动力维护好该项目 |
0 commit comments