1.0.4 • Published 9 months ago

tianci-ui v1.0.4

Weekly downloads
-
License
ISC
Repository
-
Last release
9 months ago
fromConfig: {
        labelPosition: "left",
        inline: false,
        item: [
          {
            label: "账户",
            prop: "account",
            type: "input",
            inputType: "text",
            required: true,
          },
          {
            label: "密码",
            prop: "password",
            type: "input",
            inputType: "password",
            required: true,
          },
          {
            label: "住址",
            prop: "address",
            type: "input",
            inputType: "text",
            required: true,
          },
          {
            label: "活动区域",
            prop: "select",
            type: "select",
            required: true,
            option: [
              {
                label: "选择1",
                value: "1",
              },
              {
                label: "选择2",
                value: "2",
              },
              {
                label: "选择3",
                value: "3",
              },
            ],
          },
          {
            label: "及时配送",
            prop: "delivery",
            type: "switch",
          },
        ],
      },
      fromData: {
        account: "",
        password: "",
        age: "",
        code: "",
      },
            tableData: {
        thead: [
          {
            label: "ID",
            prop: "id",
            type: "function",
            callback: (row) => {
              // console.log(row);
              if (row.id != 0) {
                if (row.id % 2 == 1) {
                  return "奇数";
                } else {
                  return "偶数";
                }
              } else {
                return row.id;
              }
            },
          },
          {
            label: "是否启用",
            prop: "initMode",
            type: "switch",
            callback: (id, value) => {
              const data = {
                initMode: value,
              };
              patchData(id, data).then((res) => console.log(res));
            },
          },
          {
            label: "日期",
            prop: "date",
            type: "images",
          },
          {
            label: "姓名",
            prop: "name",
          },
          {
            label: "地址",
            prop: "address",
          },
          {
            label: "操作",
            type: "slot",
            btn: [
              {
                btnType: "primary",
                btnName: "编辑",
                callback: async (id) => {
                  console.log(id);
                },
              },
              {
                btnType: "danger",
                btnName: "删除",
                callback: async (id) => {
                  console.log(id);
                  await del(id).then((res) => {
                    console.log(res);
                  });
                },
              },
            ],
          },
        ],
        checkbox: true,
        pagination: true,
        http: {
          url: "/data",
          method: "get",
        },
      },
1.0.4

9 months ago

1.0.3

9 months ago

1.0.2

9 months ago

1.0.1

9 months ago

1.0.0

9 months ago