192  
查询码:00000443
表格中如何使用标签
作者: 徐文斌 于 2020年07月01日 发布在分类 / 人防组 / 人防前端 下,并于 2020年07月01日 编辑

表格中如何使用标签

1、表格中使用input标签

render: (h, params) => {
            return h("div", [
                h(
                  "input",
                  {
                    props: {
                      value: params.row.score,
                    }
                  },
                )
              ]);
          }

2、表格中使用select标签,选项为普通数组

render: (h, params) => {
            return h("div", [
                h(
                "Select",
                {
                  props: {
                    value: params.row.isCanNull,
                    filterable: true,
                    clearable: true,
                  },
                  on: {
                    "on-change": event => {
                      this.listDate[params.index].isCanNull = event;
                    },
                  }
                },
                this.isCanNullList.map((item, itemIndex) => {
                  return h(
                    "Option",
                    {
                      props: {
                        value: item.value,
                      }
                    },
                    item.name
                  );
                })
              )
              ]);
          }

3、表格中使用select标签,选项为数据字典

要先把map类型的数据字典转成普通的数组

render: (h, params) => {
            const _this=this;
            let dicArr=_this.$helper.mapToArray(_this.dicData[0].data);
            return h("div", [
              h(
                "Select",
                {
                  style: {
                    width: "100%"
                  },
                  props: {
                    value: params.row.deptRowGuid,
                    filterable: true,
                    clearable: true
                  },
                  on: {
                    "on-change": event => {
                      params.row.deptRowGuid = event;
                      _this.assessmentIndexList[params.index].deptRowGuid = event;
                    },
                  }
                },
                 dicArr.map((item) => {
                  return h(
                    "Option",
                    {
                      props: {
                        value: item.key,
                        key: item.key
                      }
                    },
                    item.value
                  );
                })
              )
            ]);
          }




 推荐知识

 历史版本

修改日期 修改人 备注
2020-07-01 15:00:12[当前版本] 徐文斌 表格中如何使用标签

  目录
    知识分享平台 -V 4.8.7 -wcp