ivew中,table里面的按钮,render里面删除按钮的二次确认

  {
      title: '操作',
      key: 'action',
      fixed: 'right',
      width: 130,
      align: 'center',
      render: (h, params) => {
        return h('div', [
          h(
            'Button',
            {
              props: {
                type: 'primary',
                size: 'small'
              },
              style: {
                marginRight: '5px',
                display: that.checkPermission('/newOta/policy/edit') ? 'line' : 'none'
              },
              on: {
                click: () => {
                  that.typeInfo = 1;
                  that.versionId = params.row.id;
                  that.handleOpenModal('addPolicy');
                }
              }
            },
            '修改'
          ),
          h('Poptip', {
            props: {
              title: '您确定要删除这条数据吗?',
              transfer: true,
              confirm: true,
              placement: 'top-end'
            },
            on: {
              'on-ok': () => {
                that.id = params.row.id;
                that.delPolicy(that.id);
              }
            }
          }, [
            h('Button', {
              style: {
                marginLeft: '5px',
                display: that.checkPermission('/newOta/policy/delete') ? 'line' : 'none'
              },
              props: {
                type: 'error',
                size: 'small'
              }
            }, '删除')
          ])
        ]);
      }
    }

 

posted @ 2020-10-16 14:14  羊羊羊小童鞋  阅读(308)  评论(0编辑  收藏  举报