ivew的Table中使用render添加圖片poptip冒泡方法

效果

topti效果

ivew的Table中使用render添加圖片poptip冒泡方法

      {
        title: '操作',
        key: 'action',
        width: 120,
        align: 'center',
        render: (h, params) => {

          if(params.row.status ==0){

                  return h('div', [
                    h('span',[
                      h('poptip', {
                        props: {
                          content: '修改',
                          trigger: 'hover',
                          type: 'error',
                          size: 'small'
                        },
                        style: {
                          marginRight: '3px'
                        }
                      }, [
                        h('img' ,{
                          domProps: {
                            align: 'center',
                            src: require('../../assets/edit1.png'),
                          },
                          style: {
                            width:'15px',
                            marginRight: '15px'
                          },
                          on: {
                            click: () => {
                            this.change(params.row)
                              },
                            }
                          })
                      ])
                    ]),
                    h('span',[
                      h('poptip', {
                        props: {
                          content: '刪除',
                          trigger: 'hover',
                          type: 'error',
                          size: 'small'
                        },
                        style: {
                          marginRight: '3px'
                        }
                      }, [
                        h('img', {
                            domProps: {
                              align: 'center',
                              src: require('../../assets/delete1.png')
                            },
                            style: {
                              width:'15px'
                            },
                            on: {
                              click: () => {
                              this.del(params.row)
                                }
                              }
                          })
                        ])
                      ])
                ])
          }//end if status ==0

        }
      }
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章