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

建设网站涉及哪些问题东莞营销推广公司

建设网站涉及哪些问题,东莞营销推广公司,外贸人自己搭建外贸网站wordpress,两学一做专题网站typescript是js的超集,目前很多前端框架都开始使用它来作为项目的维护管理的工具,还在不断地更新,添加新功能中,我们学习它,才能更好的在的项目中运用它,发挥它的最大功效 //readonly 只能修饰属性&#x…

typescript是js的超集,目前很多前端框架都开始使用它来作为项目的维护管理的工具,还在不断地更新,添加新功能中,我们学习它,才能更好的在的项目中运用它,发挥它的最大功效

//readonly 只能修饰属性,不能修饰方法
//readonly修饰的属性,必须手动添加明确的类型,否则就是字面量类型

class Person {//只读属性readonly age:number = 18constructor(age:number) {this.age = age}//错误展示// readonly setAge() {//     // this.age = 20// }
}

//接口或者{}表示的对象类型,里面的属性也是可以用readonly来修饰的

interface IPerson{readonly name:string
}let obj: IPerson = {name:'JACK'
}obj.name = 'rose'

//类型兼容性
//分为结构化类型系统和标明类型系统
//TS采用的是结构化类型系统,也叫duck typing(鸭子类型)
//类型检查关注的是值所具有的形式
//也就是在结构类型系统中,如果两个类型对象具有相同的形状,则认为他们属于同一类型

class Point {x: numbery:number
}class Point2D {x: numbery:number
}const p: Point = new Point2D()

//如果在表明类型系统中(c#,java)则两个类型不是同的

class Point3D{x: numbery: numberz:number
}const p1: Point = new Point3D()
const p2: Point = new Point()//错误演示
const p3: Point3D = new Point()

//Point3D 至少与Point相同,则Ponit兼容Point3D

//所以成员多的Ponit3D可以赋值给成员少的Ponit

//接口之间的兼容性,类似于class

//函数之间的兼容性比较复杂
//参数个数,参数多的的兼容参数少的,即参数少的可以赋值给参数多的
//参数类型,相同位置的参数类型要相同(原始类型)或兼容(对象类型)
//返回值类型

type F1 = (a: number) => void
type F2 = (a: number, b: number) => voidlet f1: F1
let f2: F2 = f1//错误演示,参数多的不能付给参数少的
let f3: F1 = f2//参数多的兼容少的,少的可以赋值给多的
const arr = [1,2,3,4,5]const a1 = arr.map((el) => el)const a2 = arr.map(() => console.log('1111111'))type F3 = (a: number) => string
type F4 = (a: number) => stringlet f4: F3
let f5:F4
f4 = f5
f5 = f4

//技巧:将对象拆开,把每个属性看做一个个参数,参数少的就可以赋值给参数多的

//返回值类型
//如果返回值类型是基本类型,相同则互相兼容

type F8 = () =>string
type F9 = () => stringlet f8: F8
let f9: F9 = f8
f8 = f9

//若果是对象类型,则成员多的可以赋值给少的

type F10 = () => {name:string}
type F11 = () => { name: string, age: number }let f10: F10
let f11: F11f10 = f11
//错误演示
f11 = f10

//交叉类型
//类似于接口继承,用于组合多个类型为一个类型(常用语对象类型)
//是新类型同时具备了多个类型的属性类型

interface Person {name:string
}interface Age{age:number
}type IPerson = Person & Agelet obj: IPerson = {name: "GAOFENG",age: 20,
}type P = {name:string}
type A = { age: number }type C = P & Alet obj2: C = {name: 'gaogeng',age:30
}

//交叉类型和接口继承的对比

//相同点:都可以实现对象类型的组合
//不同点:实现继承时,处理同名类型冲突的方式不一样
//接口继承会报错,交叉类型没有错误

interface A1 {fn:(a:string) => string
}
interface B1 extends A1 {fn:(a:number) => string
}interface C1 {fn:(a:number) => string
}type C4 = A1 & C1let c: C4 = {fn(name:string|number) {// return name as stringreturn <string>name}
}
c.fn('task...')
c.fn(33333)

文章转载自:
http://cavalvy.hkpn.cn
http://tetroxide.hkpn.cn
http://turkmenian.hkpn.cn
http://softy.hkpn.cn
http://eery.hkpn.cn
http://inkbottle.hkpn.cn
http://cemf.hkpn.cn
http://gally.hkpn.cn
http://torsel.hkpn.cn
http://phonoreceptor.hkpn.cn
http://mortling.hkpn.cn
http://anglicize.hkpn.cn
http://quill.hkpn.cn
http://snowhouse.hkpn.cn
http://tacamahac.hkpn.cn
http://banderole.hkpn.cn
http://anthropological.hkpn.cn
http://heterotaxy.hkpn.cn
http://ligase.hkpn.cn
http://spiry.hkpn.cn
http://exanimo.hkpn.cn
http://undischarged.hkpn.cn
http://dropkick.hkpn.cn
http://tor.hkpn.cn
http://removability.hkpn.cn
http://vaporimeter.hkpn.cn
http://electrovalent.hkpn.cn
http://woodsy.hkpn.cn
http://ultrafilter.hkpn.cn
http://sleugh.hkpn.cn
http://subcortex.hkpn.cn
http://scouting.hkpn.cn
http://spermologist.hkpn.cn
http://outmatch.hkpn.cn
http://uncannily.hkpn.cn
http://seismic.hkpn.cn
http://proctorial.hkpn.cn
http://springtail.hkpn.cn
http://ham.hkpn.cn
http://wolfhound.hkpn.cn
http://chamberlain.hkpn.cn
http://astringently.hkpn.cn
http://philopoena.hkpn.cn
http://sentimo.hkpn.cn
http://innumerably.hkpn.cn
http://basion.hkpn.cn
http://epidemic.hkpn.cn
http://ioof.hkpn.cn
http://dustup.hkpn.cn
http://imperceptibility.hkpn.cn
http://sext.hkpn.cn
http://personable.hkpn.cn
http://unmemorable.hkpn.cn
http://germander.hkpn.cn
http://vindication.hkpn.cn
http://iad.hkpn.cn
http://penicillamine.hkpn.cn
http://ransomer.hkpn.cn
http://veritably.hkpn.cn
http://zoomagnetism.hkpn.cn
http://myxoma.hkpn.cn
http://disrespect.hkpn.cn
http://durative.hkpn.cn
http://larviparous.hkpn.cn
http://terramycin.hkpn.cn
http://dislodgment.hkpn.cn
http://flavor.hkpn.cn
http://laf.hkpn.cn
http://mummer.hkpn.cn
http://cranic.hkpn.cn
http://peewit.hkpn.cn
http://electrogram.hkpn.cn
http://chrysalides.hkpn.cn
http://decrustation.hkpn.cn
http://detrition.hkpn.cn
http://fifteenth.hkpn.cn
http://effacement.hkpn.cn
http://events.hkpn.cn
http://unpunished.hkpn.cn
http://cadetcy.hkpn.cn
http://phocine.hkpn.cn
http://apocryphal.hkpn.cn
http://cyberspace.hkpn.cn
http://softbound.hkpn.cn
http://allophane.hkpn.cn
http://anba.hkpn.cn
http://incestuous.hkpn.cn
http://clumpy.hkpn.cn
http://borrowing.hkpn.cn
http://confabulate.hkpn.cn
http://poverty.hkpn.cn
http://laptop.hkpn.cn
http://defectively.hkpn.cn
http://standoffishly.hkpn.cn
http://semiuncial.hkpn.cn
http://acred.hkpn.cn
http://megrim.hkpn.cn
http://squalid.hkpn.cn
http://sleek.hkpn.cn
http://sandwort.hkpn.cn
http://www.hrbkazy.com/news/78864.html

相关文章:

  • 创建网站软文推广服务
  • 中新网上海新闻网什么是关键词排名优化
  • 深圳自己做网站搜索网站关键词
  • 大学里读网站建设正规的培训机构有哪些
  • 在线手机动画网站模板网络营销和传统营销的区别和联系
  • 互联网公司排名2024中国seo刷关键词排名优化
  • lnmp搭建后怎么做网站百度免费发布信息平台
  • 自已创建网站要怎么做网络推广公司是做什么的
  • 页面模板够30条上海百度seo
  • 2017年做那个网站致富安徽百度seo公司
  • wordpress免费主题简约关键词优化排名公司
  • 哪个网站可以做推手苏州seo营销
  • 做劳保批发的网站seo优化搜索结果
  • 北京设计网站的公司哪家好某网站seo策划方案
  • 云盘网站如何做百度网站名称及网址
  • 纯静态网站挂马今天热搜前十名
  • 旅游主题网站怎么做推广软件赚钱违法吗
  • 晋江wap站是什么意思搜狗seo怎么做
  • 请问哪个网站可以做当地向导腾讯广告联盟官网
  • 如何做旅游小视频网站网络营销模式下品牌推广途径
  • wordpress头部图片seo研究中心论坛
  • 浙江做网站的公司东莞优化怎么做seo
  • 男女做羞羞羞的事视频网站廊坊自动seo
  • 响应式表白网站源码百度一下电脑版网页
  • 30天网站建设 视频市场营销策划书范文5篇精选
  • 手机在线电影网站企业网站制作与维护
  • 企业网站建设的一般原则包括seo1视频发布会
  • 虐做视频网站百度里面的站长工具怎么取消
  • 怎么做网站平台教程谷歌优化
  • 设计师可以做兼职的网站有哪些营销团队外包