Vue 爬坑之路(十)—— Vue2.5 + Typescript 构建项目
Typescript 在前端圈已经逐渐普及,Vue 2.5.0 改进了类型声明,使得对 TypeScript 更加友好
不过要想在项目中直接使用 TypeScript 仍然需要对项目进行一些改造
PS: 建议使用 Visual Studio Code 进行开发
vue-cli 3.0 可以直接创建 typescript 项目,不过目前还只有 beta 版,有兴趣的朋友可以尝试一下
一、安装依赖
首先还是用 vue-cli 生成项目
vue init webpack demo
然后安装必要依赖项:typescript、ts-loader、vue-class-component
npm install typescript vue-class-component -D
npm install ts-loader@3.3.1 -D
上面安装 ts-loader 的时候,指定了版本 3.3.1
这是因为在写这篇博客的时候(2018-03-14),在安装 ts-loader 的最新版 4.0.1 的情况下,启动项目会报错
另外还有几个库可以按需引入:
tslint: 规范 ts 代码,需要配合 tsllint-loader 使用,最好再加上 tslint-config-standard;
vue-property-decorator: vue-class-component 的扩展,添加了几个结合 Vue 特性的装饰器(@Emit,@Prop 等);
vuex-class: 在 vue-class-component 基础上加强了对 vuex 的支持。
二、配置 Webpack
然后修改 ./build/webpack.base.conf.js 文件:
在 resolve.extension 中添加 ‘.ts’,使引入 ts 文件时不用写 .ts 后缀
{
test: /\.tsx?$/,
loader: 'ts-loader',
exclude: /node_modules/,
options: {
appendTsSuffixTo: [/\.vue$/]
}
}
在 module.rules 中添加 webpack 对 ts 文件的解析
三、其他配置
在项目根目录下创建 tsconfig.json 文件:
// tsconfig.json
{
"compilerOptions": {
// 与 Vue 的浏览器支持保持一致
"target": "es5",
// 这可以对 `this` 上的数据属性进行更严格的推断
"strict": true,
// 如果使用 webpack 2+ 或 rollup,可以利用 tree-shake:
"module": "es2015",
"moduleResolution": "node"
}
}
完整的 tsconfig.json 配置项可以参考官方文档
在 ./src 目录创建 vue-shim.d.ts 文件,让 ts 识别 .vue 文件:
// vue-shim.d.ts
declare module "*.vue" {
import Vue from "vue";
export default Vue;
}
四、文件改造
将 src 目录下的所有 js 文件后缀改为 .ts
然后将 webpack 配置文件 ./build/webpack.base.conf.js 中的入口 entry 修改为 main.ts
改造之后的 ts 文件不会识别 .vue 文件,所以在引入 .vue 文件的时候,需要手动添加 .vue 后缀
在所有 .vue 文件中,都需要在 <script> 中添加 lang="ts" 标识
要让 TypeScript 正确推断 vue 组件选项中的类型,还需要引入 vue,并使用 Vue.extend 定义组件
至此基本改造已经完成,执行 npm run dev 就能正常启动项目
五、基于类的 Vue 组件改造
上面改造 .vue 文件的时候,只是简单的使用了 Vue.extend 方法,组件内部还是采用原生的 vue 写法
这在实际开发的时候并不能良好的使用 typescript 特性,所以还需要利用 vue-class-component 继续改造
首先在 tsconfig.json 中添加配置项,然后重启项目
// 允许从没有设置默认导出的模块中默认导入
"allowSyntheticDefaultImports": true,
// 启用装饰器
"experimentalDecorators": true
然后改造 .vue 文件的 <script> 部分,以 HelloWorld.vue 为例:
// HelloWorld.vue <script lang="ts">
import Vue from 'vue'
import Component from 'vue-class-component' // @Component 修饰符注明了此类为一个 Vue 组件
@Component({})
export default class Hello extends Vue {
msg: String = 'Welcome to Your Vue.js App'
}
</script>
组件内部不再采用 Vue 的格式,一开始也许不易接受,可以参考官方的迁移示例
// Vue 文件格式示范 <template>
<div>
<input v-model="msg">
<p>prop: {{propMessage}}</p>
<p>msg: {{msg}}</p>
<p>helloMsg: {{helloMsg}}</p>
<p>computed msg: {{computedMsg}}</p>
<button @click="greet">Greet</button>
</div>
</template> <script>
import Vue from 'vue'
import Component from 'vue-class-component' @Component({
props: {
propMessage: String
}
})
export default class App extends Vue {
// initial data
msg = // use prop values for initial data
helloMsg = 'Hello, ' + this.propMessage // lifecycle hook
mounted () {
this.greet()
} // computed
get computedMsg () {
return 'computed ' + this.msg
} // method
greet () {
alert('greeting: ' + this.msg)
}
}
</script>
六、使用TSlint 规范代码
如果对代码格式有着严格的要求,建议引入 tslint 来规范代码,首先安装以下依赖
npm init tslint tslint-loader tslint-config-standard -D
然后在 ./build/webpack.base.conf.js 的 module.rules 中添加规则
aaarticlea/png;base64,iVBORw0KGgoAAA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4w+TcY+UscXpwonzR+j5Qh5ZzQAAGIBoylZC0YDAGkBoylZC0YDAGkBoylZC0YDAGkBoylZC0YDAGkBoylZC0YDAGkBoylcCwCAhIDRFK4FAEBCwGgK1wIAICFgNIVrAQCQEDCawrUAAEgIGE3hWoTQRyvbFEVR269WPhFfhBQAgGMCRlO4lgO7/pljm6LWl42Z7gkA8hlpjJYirxMhVFBQUFlZ2d7e3tPTY7FYjEZjfX29HMsKnWKjIYTwx+sUtf5YwpwxAMg7pO+jJeZ1qtXq7u7uurq6wsLCwsLCuro6s9lcV1eXej9pcLqNhmZdFLW98pEUuwKAPEWWu864vE6tVtvW1sZHQxUVFbW1tWm1WsmPC0YDgDxHFqPF5XW2tLQYjUaVilsgWqVSGY1GHJf+9gqMBgB5TjbyOktLSw0GQ2dnZ1VVVUVFRXt7e2tra0lJieSHPuVG+8ThpbZXBqXYFQDkKVnK6ywpKbl+/Tq79fr163LoDJ16o2GfrXopr+tbY8IC+AAAHI9s5HWWlZUZDIb29vby8vLKysqOjo6uri45UjtPudEQqhlcfrVNURRFuWal2SMA5Bey53UWFhZevXrVYDDw/bLS0tKOjo7W1lb+tlQqTrnR8FmXl9p23MFlDAAEgLON7HmdJSUlcf5i7087Ojokv/c85UZLMTPw0U9vKIryumbhRwUAkIps5HW2tLTcvHmTfx6tpqbmxo0bzc3NwoE2STi7Rpt1URRFUdSbn6TPgwOAM0Q28joLCwubmpqMRqPFYunp6ens7ITfDIiRwmjYIPfbT3i4AwBSAb/rVLhWQMrn0T5xeCnKu/oVjLEBQArAaArXRsG+fZXktrLm8ic/rXthGA0AjgSMpnAtB4bfWXkj2kX7aGWborxvXv302XXonwHAEYDRFK5F0fXR1h1fgbQAICP+P019rYtBYScQAAAAAElFTkSuQmCC" alt="" />
{
test: /\.ts$/,
exclude: /node_modules/,
enforce: 'pre',
loader: 'tslint-loader'
}
在项目根目录创建配置文件 tslint.json
// tslint.json
{
"extends": "tslint-config-standard",
"globals": {
"require": true
}
}
这时已经可以启动项目了,如果出现了这样的警告
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAArUAAADECAIAAAAOI05bAAAgAElEQVR4nO3da2wb14EvcMKJX/JLTmL5IfugQLFGxw0Mq4WhhLXSpLJQULIBOUjZpKQDQSzCZaOWjQLWygUZLcQUIdJ42ebSVWhFoAKDrjoCVMoWhTiZlXdQe7SEj2HAVWBB6NpeFwPdT/tlP91P936YITk8c4YaiqJe+f8Q7FajeZxz5sycP88MZQcBAAAAKOVY7QIAAADAmoN8AAAAACzkAwAAAGAhHwAAAAAL+QAAAABY6zUfHD169OTJky+//LLL5XK5XC+//PLJkyePHj262uUCAADYCNZlPmhqajrL43K5mpqaVrt0AAAA6976ywcvvfQSNxwUtLS0rHYZAQAA1rd1lg+sZg4YmEUAAACoxnrKB0ePHrUTDrQHDXgXAQAAYMlqlQ9afKFQwN1yjLgC4QFWOOAihHiDhkXBgGk9bS2DkydP2swHZ8+ePXnyZI2qZuQNGkt5otUXCg8MhIPuZjurrwZXIBTytZ5gWr94GryEdAZCAdcJ03bhcMAXDAe9LccKS4Le4gotvlDIom6cWrsCYXbZMVcgFPKt+qOhwPjs7GiAEEJIc+yr+bufe9k1vJ/P3B0PlZzhoZn5ydAKFRAAYGXUbv7ghIs/YhSGhuKwURxqjrmD4aD7GH+Pr7zyijEB+N67LN3/x3//339IvHzwyiuv1KpmRZ2BcNB7jBByrNnlDYbDoYC39USzOxAKhwLuVm2MNY6Opf97IGgae2rvWIs3GA66TxSKUmz8fImavcFwOOAqOQvaWsdcgVDQ20JKt9M0e4PhoLckV7T6QiFvS2k+0H5g88Exly8UDnr1QbfZ1dnKBpSV0XxJfjwz1EkIIc2hyfmFEoUM4B6amZ0MkWIuYP8/AMD6V5t8wI4dzO948wde9hOteQcul8uYAKT//J///sd//h+LfOBy1fiDemlxw6FgKFzyYzAcDrpPrLl8kOcNhgNe45xN0Fss0TGX1+vizzAMDAwE/5dhu2CQt1rQS0izN8RZzMkHze5AKBQwzLmca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qO9Aj89uR3Ws4+uXW3OFCBoS9ZthJb97PxLFWyF7udAiFNndExhU7FtbNJpaS/iQjtvalpmo13VrAm35q8CXBOcWUtz2lkzj434j3EyvmElKN0ytAPrK+j0sLzD8S/L5n3yR/4qrvirGpkPUQS02VoX5XvH3gSNyjNSclP0gql8kgv/7OexTSL0JWQcpRSKk8kosPFoF2i0CKne1JTimGh9Zo8zg8yVEkb7r4d8an87NnZeJbmP6+f7kkWX/jUStsRuSopOUqpNkujvUZkOHpxodAdz8g5SilVJDE5WjidbT2D+nJqfnVZ6E5KtORvHtj4/kLbhbTWdNKVvp5BufAiuqnwhBBCTkUzOWp+o61USY2yw/lvjfP2aXlxmg9ke3P/sMx774nfdKbzbtEZOEe3vuTYDkZIJfmAu3m5TlvsNlrTsfmA2yC8hfy6Cz/Jv1dvPJuc9uR2WstGNteddyCLvmTVSqb3EzveS2Xz502eSPbkvxegn03DFWd7Ta61eBOwOsX2Wp7fyNy+tPHuIZZMo+ki15Gh8BYHMp9N3j75+aDaK45bI62hytxtSnqIbVV9f2G5/+xUTXmS03T5/nxELb4PrcnP9X2jCH1pxeIlsg3FdrfhNsg3pZXWixrcBGpxitFtGGhk26r4+0hvpWT9Ox6CsysqDvYtX6lqYql/P5GrRvlgKX8/EdaP2sVKWHk4m7DBVfP3EwX3gKjNUFE5m+5fB3MJbf2ipP+h3CrV5tbQ3CdOV/zvL8D6gRFlI8HZhA0O/34jAAAAsJAPAAAAgIV8AAAAACzkAwAAAGD9fzu8AOyf6I4bAAAAAElFTkSuQmCC" alt="" />
只需要在 main.ts 里面,将实例化的 Vue 赋值给一个对象就好
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOUAAAAdCAIAAADaajw1AAAHZ0lEQVR4nO2a708a2RrH9y85BLvjBRdKSMEt9HJtcWGZCFS8OGqiKcFuJJFu7NUXmlDX3GJKKqmYnTbc27ONYRNCtqUZ1hfKCyURYoBkybyYnDfllX8B7/qO3Bf8GmEYBrtsl73nE97M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xFXUzav6xvVIj9z0xnTHOAmPP/mR4avoyGrviUOdXvz6q119rH755AJ+v/vrXotOhSo9i+sKy3/3XWKxXiWC9/oEsvj7nuFIqKJRjjfunHHf8vO+CFtar5CimbyzBVInjzg+9nbp0vTzluPP4+lR/ksV6lRzFXAOl9/W5oF4BsGzHT/9C//+KwXSC9YoZJsT0evfu3T9sHhiMFLBeMcME1itmmPgf9+DoQKVUtmkAAAAASUVORK5CYII=" alt="" />
只是这里的 tslint 校验规则是直接引入的 standard 规范,如果需要自定义
贴一篇网上找的 tslint.json 的配置项说明(来源:http://blog.csdn.net/zw52yany/article/details/78688837)
extends: 内设配置项名称
rules: 规则
{
//ts专用
adjacent-overload-signatures : true, // Enforces function overloads to be consecutive.
ban-comma-operator:true, //禁止逗号运算符。
ban-type: [true, ["object","User {} instead."],["string"]] //禁止类型
member-access: [true , "no-public"||"check-accessor"|| "check-constructor" || "check-parameter-property" ] , //类成员必须声明 private public ....
member-order: [true, {order:....}], //类声明排序
no-any: true,//不需使用any类型
no-empty-interface:true //禁止空接口 {}
no-import-side-effect: [true, {"ignore-module": "(\\.html|\\.css)$"}], //禁止导入带有副作用的语句
no-inferrable-types:[true, "ignore-params", "ignore-properties"], //不允许将变量或参数初始化为数字,字符串或布尔值的显式类型声明。
no-internal-module:true, //不允许内部模块
no-magic-numbers: [true,,,], //不允许在变量赋值之外使用常量数值。当没有指定允许值列表时,默认允许-1,0和1
no-namespace: [ true,"allpw-declarations"], //不允许使用内部modules和命名空间
no-non-null-assertion: true , //不允许使用!后缀操作符的非空断言。
no-parameter-reassignment: true, //不允许重新分配参数
no-reference: true, // 禁止使用/// <reference path=> 导入 ,使用import代替
no-unnecessary-type-assertion: true, //如果类型断言没有改变表达式的类型就发出警告
no-var-requires: true, //不允许使用var module = require("module"),用 import foo = require('foo')导入
only-arrow-functions:[true,"allow-declarations","allow-named-functions"], //允许箭头表达式,不需要传统表达式 ; 允许独立的函数声明 ;允许表达,function foo() {}但不是function() {}
prefer-for-of:true, //建议使用for(..of)
promise-function-async: true, 要求异步函数返回promise
typedef: [true, "call-signature", "parameter", "member-variable-declaration"], //需要定义的类型存在
typedef-whitespace: true, //类型声明的冒号之前是否需要空格
unified-signatures: true, //重载可以被统一联合成一个 //function 专用
await-promise: true, //警告不是一个promise的await
ban: [
true,
"eval",
{"name": "$", "message": "please don't"},
["describe", "only"],
{"name": ["it", "only"], "message": "don't focus tests"},
{
"name": ["chai", "assert", "equal"],
"message": "Use 'strictEqual' instead."
},
{"name": ["*", "forEach"], "message": "Use a regular for loop instead."}
],
curly: true, //for if do while 要有括号
forin:true, //用for in 必须用if进行过滤
import-blacklist:true, //允许使用import require导入具体的模块
label-postion: true, //允许在do/for/while/swith中使用label
no-arg:true, //不允许使用 argument.callee
no-bitwise:true, //不允许使用按位运算符
no-conditional-assignmen: true, //不允许在do-while/for/if/while判断语句中使用赋值语句
no-console:true, //不能使用console
no-construct: true, //不允许使用 String/Number/Boolean的构造函数
no-debugger: true, //不允许使用debugger
no-duplicate-super: true, //构造函数两次用super会发出警告
no-empty:true, //不允许空的块
no-eval: true, //不允许使用eval
no-floating-promises: true, //必须正确处理promise的返回函数
no-for-in-array: true, //不允许使用for in 遍历数组
no-implicit-dependencies: true, //不允许在项目的package.json中导入未列为依赖项的模块
no-inferred-empty-object-type: true, //不允许在函数和构造函数中使用{}的类型推断
no-invalid-template-strings: true, //警告在非模板字符中使用${
no-invalid-this:true, //不允许在非class中使用 this关键字
no-misused-new: true, //禁止定义构造函数或new class
no-null-keyword: true, //不允许使用null关键字
no-object-literal-type-assertion:true, //禁止objext出现在类型断言表达式中
no-return-await:true, //不允许return await
arrow-parens: true, //箭头函数定义的参数需要括号
}
Vue 爬坑之路(十)—— Vue2.5 + Typescript 构建项目的更多相关文章
- Vue 爬坑之路(十二)—— vue-cli 3.x 搭建项目
Vue Cli 3 官方文档:https://cli.vuejs.org/zh/guide/ 一.安装 @vue/cli 更新到 3.x 之后,vue-cli 的包名从 vue-cli 改成了 @vu ...
- Vue 爬坑之路(九)—— 用正确的姿势封装组件
迄今为止做的最大的 Vue 项目终于提交测试,天天加班的日子终于告一段落... 在开发过程中,结合 Vue 组件化的特性,开发通用组件是很基础且重要的工作 通用组件必须具备高性能.低耦合的特性 为了满 ...
- Vue 爬坑之路(一)—— 使用 vue-cli 搭建项目
vue-cli 是一个官方发布 vue.js 项目脚手架,使用 vue-cli 可以快速创建 vue 项目,GitHub地址是:https://github.com/vuejs/vue-cli vue ...
- Vue 爬坑之路(六)—— 使用 Vuex + axios 发送请求
Vue 原本有一个官方推荐的 ajax 插件 vue-resource,但是自从 Vue 更新到 2.0 之后,官方就不再更新 vue-resource 目前主流的 Vue 项目,都选择 axios ...
- Vue 爬坑之路—— 使用 Vuex + axios 发送请求
Vue 原本有一个官方推荐的 ajax 插件 vue-resource,但是自从 Vue 更新到 2.0 之后,官方就不再更新 vue-resource 目前主流的 Vue 项目,都选择 axios ...
- vue爬坑之路1-路由跳转全新页面以及二级页面配置
之前也在网找了一些答案,比较零碎,特此总结下,废话不多说,直接上干货! 路由跳转全新页面 首先在app.vue中先定义router-view,这是主路由. 在router的index.js中引入log ...
- Vue 爬坑之路(二)—— 组件之间的数据传递
Vue 的组件作用域都是孤立的,不允许在子组件的模板内直接引用父组件的数据.必须使用特定的方法才能实现组件之间的数据传递. 首先用 vue-cli 创建一个项目,其中 App.vue 是父组件,com ...
- Vue 爬坑之路(四)—— 与 Vuex 的第一次接触
在 Vue.js 的项目中,如果项目结构简单, 父子组件之间的数据传递可以使用 props 或者 $emit 等方式 http://www.cnblogs.com/wisewrong/p/62660 ...
- Vue 爬坑之路(八)—— 使用 Echarts 创建图表
在后台管理系统中,图表是一个很普遍的元素.目前常用的图标插件有 charts, Echarts, highcharts.这次将介绍 Echarts 在 Vue 项目中的应用. 一.安装插件 使用 c ...
随机推荐
- 7. Bagging & Random Forest
通过前面集成学习的介绍我们知道,欲得到泛化性能强的集成学习器,集成中个体学习器应尽量相互独立:虽然“独立”在现实任务中无法做到,但可以设法使基学习器尽可能具有较大差异. 1. Bagging 自助采样 ...
- vue教程2-08 自定义键盘信息、监听数据变化vm.$watch
vue教程2-08 自定义键盘信息 @keydown.up @keydown.enter @keydown.a/b/c.... 自定义键盘信息: Vue.directive('on').keyCode ...
- Wilcoxon-Mann-Whitney rank sum test
Wilcoxon-Mann-Whitney ranksum test 无节点状况,假定为样本服从类似形状,如果不是类似形状的话,秩的比较没有过多意义. X有m个数,Y有n个数 \(H_0:\mu_1= ...
- odoo开发笔记 -- odoo源码解析
odoo 源码解析:http://blog.csdn.net/weixin_35737303
- npm安装第三方库找不到“cl.exe”问题
1.安装第三方库时找不到"cl.exe"的解决方法 安装 本地 remix时 出现错误(npm install remix-ide -g) 原因:remix 依赖的 python库 ...
- 通过XMLHttpRequest和jQuery两种方式实现ajax
一.XMLHttpRequest实现获取数据 不使用jQuery实现页面不刷新获取内容的方式,我们这里采用XMLHttpRequest原生代码实现:js代码如下: //1.获取a节点,并为其添加Onc ...
- MySQL笔记(1)---MySQL体系结构和存储引擎
1.前言 本系列记录MYSQL数据库的一些结构和实现特点,方便查询. 2.基本概念 数据库:物理操作系统文件或者其他形式文件类型的集合.MySQL中数据库文件可以是frm.MYD.MYI.ibd结尾的 ...
- 兼容IE9以下和非IE浏览器的原生js事件绑定函数
事件绑定函数的demo如下: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "htt ...
- spring cloud sleuth
新建spring boot工程trace-1,添加pom依赖 <dependency> <groupId>org.springframework.cloud</group ...
- 【转】Intellij IDEA使用总结
原文地址:http://totohust.iteye.com/blog/1035550 1. IDEA内存优化 先看看你机器本身的配置而配置. \IntelliJ IDEA 8\bin\idea.ex ...