├── .gitignore
├── dist.zip
├── babel.config.js
├── src
├── assets
│ └── img
│ │ └── about.jpg
├── vue-shim.d.ts
├── App.vue
├── main.ts
├── unit
│ └── decorator.ts
├── router
│ └── index.js
├── pages
│ ├── about.vue
│ ├── home.vue
│ ├── login.vue
│ └── register.vue
└── style
│ └── reset.css
├── types
└── index.d.ts
├── postcss.config.js
├── index.html
├── upload
├── config.js
├── upload.js
└── spinner_style.js
├── webpack
├── webpack.dev.js
├── webpack.base.js
└── webpack.prod.js
├── tsconfig.json
├── package.json
└── README.md
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | dist/
--------------------------------------------------------------------------------
/dist.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bgwd666/deploy/HEAD/dist.zip
--------------------------------------------------------------------------------
/babel.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | presets: ["@babel/env"]
3 | }
--------------------------------------------------------------------------------
/src/assets/img/about.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bgwd666/deploy/HEAD/src/assets/img/about.jpg
--------------------------------------------------------------------------------
/src/vue-shim.d.ts:
--------------------------------------------------------------------------------
1 | declare module "*.vue" {
2 | import Vue from "vue";
3 | export default Vue;
4 | }
5 |
--------------------------------------------------------------------------------
/types/index.d.ts:
--------------------------------------------------------------------------------
1 | declare module 'vue/types/vue' {
2 | interface Vue {
3 | $Message: any,
4 | $axios: any
5 | this: any
6 | }
7 | }
--------------------------------------------------------------------------------
/src/App.vue:
--------------------------------------------------------------------------------
1 |
2 | hello {{msg}}
5 |
7 | 10 | 类型系统实际上是最好的文档,大部分的函数看看类型的定义就可以知道如何使用了 11 | 可以在编译阶段就发现大部分错误,这总比在运行时候出错好 12 | 增强了编辑器和 IDE 的功能,包括代码补全、接口提示、跳转到定义、重构等 13 |
14 |17 | TypeScript 是 JavaScript 的超集,.js 文件可以直接重命名为 .ts 即可 18 | 即使不显式的定义类型,也能够自动做出类型推论 19 | 可以定义从简单到复杂的几乎一切类型 20 | 即使 TypeScript 编译报错,也可以生成 JavaScript 文件 21 | 兼容第三方库,即使第三方库不是用 TypeScript 写的,也可以编写单独的类型文件供 TypeScript 读取 22 |
23 |8 | {{item.text}} 9 |
10 |