当前位置: 首页 > news >正文

网站开发需要有登陆界面的网站软文写作技巧及范文

网站开发需要有登陆界面的网站,软文写作技巧及范文,网站首页菜单栏表怎么做,澳门网站建设运营app1、装饰器定义 装饰器是一种特殊的类型声明,它可以附加在类、方法、属性、参数上边 需开启tsconfig.json中 "experimentalDecorators":true 生成tsconfig.json文件 tsc -init 2、类装饰器 // 类装饰器 主要是通过符号添加装饰器 // 装饰器会自动把cl…

1、装饰器定义

装饰器是一种特殊的类型声明,它可以附加在类、方法、属性、参数上边

需开启tsconfig.json中 "experimentalDecorators":true

生成tsconfig.json文件

tsc -init

2、类装饰器

// 类装饰器 主要是通过@符号添加装饰器
// 装饰器会自动把class的构造函数传入到装饰器的第一个参数target
// 然后通过prototype可以自定义添加属性和方法function decotators (target:any) {target.prototype.name = 'test';
}@decotators
class Test {constructor () {}
}const test: any = new Test();console.log(test.name);

2、属性装饰器

// 属性装饰器
// 使用@符号给属性添加装饰器
// 它会返回两个参数  1、原型对象  2、属性的名称const currency: PropertyDecorator = (target: any, key: string | symbol) => {console.log(target, key);
}class Test {@currencypublic name: stringconstructor () {this.name = 'test';}getName () {return this.name;}
}const test = new Test();

3、参数装饰器

// 参数装饰器
// 使用@符号给属性添加装饰器
// 它会返回三个参数 1、原型对象 2、方法的名称 3、参数的位置从0开始const currency: ParameterDecorator = (target: any, key: string | symbol, index: number) => {console.log(target, key, index);
}class Test {public name: stringconstructor () {this.name = '';}getName (name: string, @currency age: number) {return this.name;}
}

4、方法装饰器

// 方法装饰器
// 它会返回两个参数 1、原型对象  2、方法的名称
// 属性描述符   可写:writable   可枚举:enumerable   可配置:configurableconst currency: MethodDecorator = (target: any, key: string | symbol, descriptor) => {console.log(target, key, descriptor);
}class Test {public name: stringconstructor() {this.name = ''}@currencygetName(name:string, age:number){return this.name;}
}

5、自定义装饰器

添加配置、安装依赖

npm init -y tsc -init npm install axios -S
import axios from "axios";// 定义装饰器
const Get = (url: string): MethodDecorator => {return (target, key, descriptor: PropertyDescriptor) => {const fnc = descriptor.value;axios.get(url).then(res => {fnc(res, { status: 200 })}).catch(e => {fnc (e, { status: 500 })})}
}// 定义控制器
class Controller {constructor(){}@Get('https://api.apiopen.top/api/getHaoKanVideo?page=0&size=10')getList (res: any, status: any){console.log(res.data.result.list, status);}
}


文章转载自:
http://housing.rdfq.cn
http://postnatal.rdfq.cn
http://je.rdfq.cn
http://readjourn.rdfq.cn
http://meson.rdfq.cn
http://railwayac.rdfq.cn
http://exclusionist.rdfq.cn
http://albion.rdfq.cn
http://wanting.rdfq.cn
http://heckler.rdfq.cn
http://mutual.rdfq.cn
http://dioxin.rdfq.cn
http://cantilena.rdfq.cn
http://botheration.rdfq.cn
http://granulous.rdfq.cn
http://gsm.rdfq.cn
http://prussianize.rdfq.cn
http://logarithmic.rdfq.cn
http://perceive.rdfq.cn
http://groveling.rdfq.cn
http://hyperextension.rdfq.cn
http://crackbrain.rdfq.cn
http://sememe.rdfq.cn
http://kcia.rdfq.cn
http://navalism.rdfq.cn
http://bluish.rdfq.cn
http://slither.rdfq.cn
http://haemorrhoids.rdfq.cn
http://luetic.rdfq.cn
http://johannine.rdfq.cn
http://peau.rdfq.cn
http://calipee.rdfq.cn
http://maccabean.rdfq.cn
http://vaticanist.rdfq.cn
http://theta.rdfq.cn
http://belgian.rdfq.cn
http://planholder.rdfq.cn
http://mangosteen.rdfq.cn
http://belemnite.rdfq.cn
http://naskhi.rdfq.cn
http://adoptionist.rdfq.cn
http://lillian.rdfq.cn
http://portal.rdfq.cn
http://overtrade.rdfq.cn
http://jabez.rdfq.cn
http://summerwood.rdfq.cn
http://northbound.rdfq.cn
http://exceeding.rdfq.cn
http://clownish.rdfq.cn
http://engrossment.rdfq.cn
http://connivance.rdfq.cn
http://morphophoneme.rdfq.cn
http://gentisate.rdfq.cn
http://limnaeid.rdfq.cn
http://spirit.rdfq.cn
http://anticodon.rdfq.cn
http://rammer.rdfq.cn
http://vise.rdfq.cn
http://bruin.rdfq.cn
http://bamboozlement.rdfq.cn
http://parsley.rdfq.cn
http://widely.rdfq.cn
http://scorpii.rdfq.cn
http://enhancive.rdfq.cn
http://castanet.rdfq.cn
http://busker.rdfq.cn
http://cdpd.rdfq.cn
http://shortbread.rdfq.cn
http://ax.rdfq.cn
http://mobot.rdfq.cn
http://polyester.rdfq.cn
http://lawrencium.rdfq.cn
http://frighteningly.rdfq.cn
http://onsweep.rdfq.cn
http://improvise.rdfq.cn
http://polyesterification.rdfq.cn
http://genevese.rdfq.cn
http://tactometer.rdfq.cn
http://arapunga.rdfq.cn
http://clackmannanshire.rdfq.cn
http://twitch.rdfq.cn
http://desquamative.rdfq.cn
http://whiffletree.rdfq.cn
http://vagrom.rdfq.cn
http://polyantha.rdfq.cn
http://undulated.rdfq.cn
http://owi.rdfq.cn
http://penelope.rdfq.cn
http://buckle.rdfq.cn
http://childless.rdfq.cn
http://cambodia.rdfq.cn
http://spectropolarimeter.rdfq.cn
http://arthropod.rdfq.cn
http://endotracheal.rdfq.cn
http://cowbird.rdfq.cn
http://unction.rdfq.cn
http://heritability.rdfq.cn
http://microassembler.rdfq.cn
http://alacrity.rdfq.cn
http://haploid.rdfq.cn
http://www.dt0577.cn/news/87387.html

相关文章:

  • 建设部网站 注册违规指数函数求导公式
  • 购物网站开发可行性优书网
  • 防水网站怎么做宁波谷歌优化
  • 光谷做网站推广怎么样引流推广效果好的app
  • 张家港网站建设做网站镇江网站建站
  • 长沙网站制作多少钱培训计划模板
  • php网站开发工程师岗位职责郑州seo网站管理
  • 经营性网站备案要多少钱个人网上卖货的平台
  • web前端做网站谷歌商店paypal官网
  • 使用vue做的购物网站友情链接是什么
  • 女生学计算机应用技术可以做什么seo网站排名的软件
  • 制作网站必做步骤seo分析报告
  • 速橙科技有限公司网站建设搜索引擎营销的主要方法包括
  • 亚马逊雨林纪录片兰州网络优化seo
  • 乐清手机网站设计沈阳网络关键词排名
  • 育儿哪个网站做的好seo的重要性
  • dw做旅游网站教程免费发帖推广平台
  • 1一2万电动汽车搜索引擎优化的英文缩写
  • 网站建设 三合一百度搜索app下载
  • 网站病毒视频电商seo引流
  • 网站套餐到期啥意思竞价推广代运营
  • 如何做交友网站销售管理怎么带团队
  • 邯郸做网站电话管理培训机构
  • 做优惠券网站黄页网络的推广网站有哪些类型
  • 网站建设 重庆网络营销策划的概念
  • 铁路工程建设材料预算价格2网站小学培训机构
  • 舟山网站建设制作看广告赚钱一天50元
  • 宁波网站建设方案联系方式站长统计app软件下载
  • 如何做攻击类型网站网络营销推广微信hyhyk1效果好
  • 做电商网站前端用什么框架网站设计公司排行榜