2023年Web前端UI框架推荐
1、View UI Plus
https://iviewui.com/
2、Navie UI
https://www.naiveui.com/zh-CN/os-theme
3、Element Plus
https://element-plus.gitee.io/zh-CN/
4、Layui
https://layui.gitee.io/v2/
5、Bootstrap
https://www.bootcss.com/
1、View UI Plus
https://iviewui.com/
2、Navie UI
https://www.naiveui.com/zh-CN/os-theme
3、Element Plus
https://element-plus.gitee.io/zh-CN/
4、Layui
https://layui.gitee.io/v2/
5、Bootstrap
https://www.bootcss.com/
var num = new Number(1777.123488);
console.log(num.toLocaleString()); // 输出:1,777.123
console.log(num.toString()); // 输出:1777.123488
var dateStr = new Date();
console.log(dateStr.toLocaleString()); // 输出:2022/2/15 16:48:35
console.log(dateStr.toString()); // 输出:Tue Feb 15 2022 16:48:58 GMT+0800 (中国标准时间)
元组类型用来表示已知元素数量和类型的数组,各元素的类型不必相同,对应位置的类型需要相同。
let x: [a:string, b:number];
x = ['abc', 100] //okay
x = [12, 'hello']; //error
console.log(x[0]); //abc
当接口继承了一个类类型时,它会继承类的成员但不包括其实现。 就好像接口声明了所有类中存在的成员,但并没有提供具体实现一样。 接口同样会继承到类的private和protected成员。 这意味着当你创建了一个接口继承了一个拥有私有或受保护的成员的类时,这个接口类型只能被这个类或其子类所实现(implement)。
class C {
p = 12;
m() {
}
}
let c = new C();
let clone = { ...c };
clone.p; // ok
clone.m(); // error!
表示一个已知元素数量和类型的数组,各元素的类型不必相同。 比如,你可以定义一对值分别为string
和number
类型的元组。
// Declare a tuple type
let x: [string, number];
// Initialize it
x = ['hello', 10]; // OK
// Initialize it incorrectly
x = [10, 'hello']; // Error
console.log(x[0].substr(1)); // OK
console.log(x[1].substr(1)); // Error, 'number' does not have 'substr'
x[3] = 'world'; // OK, 字符串可以赋值给(string | number)类型
console.log(x[5].toString()); // OK, 'string' 和 'number' 都有 toString
x[6] = true; // Error, 布尔不是(string | number)类型