iview 数据表格中 启用停用显示判断

status: {

      title: '状态',

      align: 'center',

      minWidth: 80,

      key: 'status',

      render: (h, params) => {

        let value = params.row.status

        if (typeof value === 'undefined' || value === null || value === '') {

          value = '--'

        }

        return h(

          'Tag',

          {

            props: {

              color: value === 1 ? 'error' : 'success'

            },

            style: {

              cursor: 'pointer'

              // marginRight: '10px'

            },

            on: {

              click: () => {}

            }

          },

          value === 1 ? '停用' : '启用'

        )

      }

    },

发布了58 篇原创文章 · 获赞 0 · 访问量 5103

猜你喜欢

转载自blog.csdn.net/qq_40295815/article/details/105425587