
typescript学习
一颗腐烂的橘子
这个作者很懒,什么都没留下…
展开
-
Vue+Typescript实战开发-封装组件
熟悉Typescript如何在vue项目中使用独立封装一个button组件UIbutton.vue中的代码<template> <div> <button :class="{'ui-btn-large' : large, 'ui-btn-small' : small, 'ui-btn-xlarge': xlarge,...原创 2020-05-01 23:37:21 · 1215 阅读 · 0 评论 -
使用下一代前端开发语言Typescript写爬虫
Typescript写爬虫项目打包 "scripts": { "dev": "ts-node ./src/index.ts", "build":"tsc" },npm run build这时候就会把ts文件编译成js文件然后打包,在tsconfig.json找到 “outDir”: “./build”, 把注释去掉就可以了,然后就会产生打包文件夹build...原创 2020-04-29 22:53:51 · 315 阅读 · 0 评论 -
Typescript变量类型包括高级类型详解(全)
Typescript我们先来看下如何为一个变量指定类型:为一个变量指定类型的语法是使用"变量: 类型"的形式,如下:let num: number = 1231.布尔类型类型为布尔类型的变量的值只能是 true 或 false,如下:let bool: boolean = false;bool = true;bool = 123; // error 不能将类型"123"分配给类型"...原创 2020-04-25 14:23:49 · 7268 阅读 · 0 评论 -
下一代前端开发语言Typescript之编写第一个Typescript程序
TypeScript注意编译Typescript项目之前需要确保安装了node.js编译.ts文件项目需要打开终端输出tsc index.ts 之后会生成一个index.js文件// //ts中创建接口使用interfaceinterface Person { firstName: string lastName: string}function person(...原创 2020-04-19 22:18:43 · 257 阅读 · 0 评论 -
下一代前端开发语言typescript学习之安装typescript
打开终端windows电脑中 使用npm install -g typescript 全局安装最新版本mac电脑中 使用sodu npm install -g typescript 输入密码后全局安装最新版本 如果不加sodu会报错查看是否安装成功typescript使用命令: tsc-v恭喜你成功安装typescript...原创 2020-04-17 14:04:19 · 314 阅读 · 2 评论