可以使用接口约束

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,
        },
      ],
    };
  },
Logo

前往低代码交流专区

更多推荐