vue+ts对data变量定义变量约束
可以使用接口约束interface itableData {date: string;name: string;address: number;}interface iData {num: string;count: number;obj: {age: number;name: string;};tableData: itableData[];}export default {data(): iD
·
可以使用接口约束
interface itableData {
date: string;
name: string;
address: number;
}
interface iData {
num: string;
count: number;
obj: {
age: number;
name: string;
};
tableData: itableData[];
}
export default {
data(): iData {
return {
num: "1",
count: 1,
obj: {
age: 1,
name: "liubin",
},
tableData: [
{
date: "2016-05-02",
name: "王小虎",
address: 1,
},
{
date: "2016-05-04",
name: "王小虎",
address: 1,
},
{
date: "2016-05-01",
name: "王小虎",
address: 1,
},
{
date: "2016-05-03",
name: "王小虎",
address: 1,
},
],
};
},
更多推荐
已为社区贡献5条内容
所有评论(0)