国产亚洲精品福利在线无卡一,国产精久久一区二区三区,亚洲精品无码国模,精品久久久久久无码专区不卡

當(dāng)前位置: 首頁 > news >正文

中拓網(wǎng)絡(luò)科技有限公司北京seo不到首頁不扣費

中拓網(wǎng)絡(luò)科技有限公司,北京seo不到首頁不扣費,企必搜做網(wǎng)站,電商網(wǎng)站可維護性1. 接口有什么用 通過 interface 定義接口。 檢測對象的屬性,不會去檢查屬性的順序,只要相應(yīng)的屬性存在并且類型也是對的就可以。 interface IPerson {name: string;age: number; } function say(person: IPerson): void {console.log(my name is ${pers…

1. 接口有什么用

通過 interface 定義接口。

檢測對象的屬性,不會去檢查屬性的順序,只要相應(yīng)的屬性存在并且類型也是對的就可以。

interface IPerson {name: string;age: number;
}
function say(person: IPerson): void {console.log(`my name is ${person.name}, and age is ${person.age}`);
}
let me = {name: "funlee",age: 18,
};
say(me); // my name is funlee, and age is 18

2. 可選屬性

屬性后面加一個 ? 符號,表示該屬性可選。

interface IPerson {name: string;age: number;// love 可選love?: string;
}

3. 只讀屬性

屬性名前加 readonly,表示該屬性只讀。

interface IPerson {// name 只讀readonly name: string;age: number;love?: string;
}
let me: IPerson = {name: "funlee",age: 18,
};
// name 不允許被賦值
me.name = "new name"; // error!

4. 函數(shù)接口

接口可以描述函數(shù)類型,它定義了函數(shù)的參數(shù)列表和返回值類型,參數(shù)列表里的每個參數(shù)都需要名字和類型,函數(shù)的參數(shù)名不需要與接口里定義的名字相匹配,只需要類型兼容就可以了。

interface GetArea {(width: number, height: number): number;
}
let getArea: GetArea = function (w: number, h: number) {return w * h;
};
getArea(5, 6); // 30

?5. 繼承接口

一個接口可以繼承多個接口,創(chuàng)建出多個接口的合成接口,如:

interface Shape {color: string;
}
interface PenStroke {penWidth: number;
}
interface Square extends Shape, PenStroke {sideLength;
}
const square = <Square>{};
square.color = "blue";
square.sideLength = 10;
square.penWidth = 5.0;

?6. 混合類型

讓對象同時作為函數(shù)和對象使用,并帶有額外的屬性,如:

interface MixedDemo {(str: string): void;defaultStr: string;
}function foo(): MixedDemo {let x = <MixedDemo>function (str: string) {console.log(str);};x.defaultStr = "Hello, world";return x;
}let c = foo();
c("This is a function"); // 'This is a function'
c.defaultStr; // 'Hello, world'

?

http://aloenet.com.cn/news/34004.html

相關(guān)文章:

  • 廣州最新發(fā)布最新百度seo新站優(yōu)化
  • 一臺云服務(wù)器做多個網(wǎng)站惠州seo外包服務(wù)
  • 成都網(wǎng)站建設(shè)名錄海南seo排名優(yōu)化公司
  • crm與scrmseo短視頻網(wǎng)頁入口引流網(wǎng)站
  • linux系統(tǒng)網(wǎng)站空間正規(guī)seo關(guān)鍵詞排名哪家專業(yè)
  • 展示網(wǎng)站動畫怎么做的站長工具seo綜合查詢官網(wǎng)
  • 怎么自己做網(wǎng)站的步驟百度推廣是做什么的
  • 網(wǎng)站刷新新前臺是什么意思2345網(wǎng)址中國最好
  • 高端網(wǎng)站開發(fā)建設(shè)網(wǎng)絡(luò)營銷知識點
  • 網(wǎng)站后臺使用說明西安百度代運營
  • 企業(yè)怎么建網(wǎng)站太原百度網(wǎng)站快速優(yōu)化
  • 如何用dw做網(wǎng)站首頁seo優(yōu)化排名推廣
  • 武漢網(wǎng)站關(guān)鍵詞廣州最新新聞事件
  • 網(wǎng)站開發(fā)難嗎200891
  • 一般網(wǎng)站服務(wù)器配置高端網(wǎng)站建設(shè)企業(yè)
  • 網(wǎng)站建設(shè)全攻略百度谷歌seo優(yōu)化
  • 模塊網(wǎng)站開發(fā)合同注冊域名費用一般多少錢
  • 做網(wǎng)站一定要用cms嗎簡述seo的基本步驟
  • 大連企業(yè)做網(wǎng)站seo按天計費系統(tǒng)
  • 網(wǎng)站做微信支付對接市場營銷方案怎么做
  • 做logo好的網(wǎng)站北京網(wǎng)站快速排名優(yōu)化
  • 代充網(wǎng)站怎么做網(wǎng)站建設(shè)制作費用
  • 上海百度嘉定公司網(wǎng)頁設(shè)計提升seo排名
  • 安徽城鄉(xiāng)建設(shè)廳網(wǎng)站一鍵關(guān)鍵詞優(yōu)化
  • 做醫(yī)療網(wǎng)站聚名網(wǎng)域名注冊
  • 網(wǎng)站服務(wù)器 優(yōu)幫云外貿(mào)推廣代理
  • 鄰水網(wǎng)站建設(shè)友情鏈接檢測659292
  • 鎮(zhèn)江手機網(wǎng)站建設(shè)seo基礎(chǔ)篇
  • 海南最新情況最新消息今天網(wǎng)站seo入門基礎(chǔ)教程
  • 排名優(yōu)化網(wǎng)站網(wǎng)絡(luò)推廣哪家好