接口
interface LabelType {
label: string;
}
function printLabel(labelObj: LabelType) {
console.log(labelObj.label)
}interface Label {
label: string;
width?: number;
}interface Point {
readonly x: string;
}
const a: Point = {x:'1'}
// cannot assign to 'x' because it is a read-only property.
a.x = '2';Last updated