在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問答/HTML/ 怎樣在iview的Table表格中添加下拉菜單?

怎樣在iview的Table表格中添加下拉菜單?

我怎么在table表格里面添加下拉菜單

render: (h, params) => {
                return h('div', [
                    h('Button', {
                        props: {
                            type: 'primary',
                            size: 'small'
                        },
                        style: {
                            marginRight: '5px'
                        },
                        on: {
                            click: () => {
                                this.show(params);
                            }
                        }
                    }, '詳情'),
                    h('Button', {
                        props: {
                            type: 'error',
                            size: 'small'
                        },
                         style: {
                            marginRight: '5px'
                        },
                        on: {
                            click: () => {
                               if(window.confirm('你確定刪除該員工信息嗎?')){
                                     //alert("確定");
                                     const index=params.index;
                                     
                                     console.log(this.data3[index].userid);//刪除用戶的ID
                                     axios.post(//發(fā)送數(shù)據(jù),重新獲取database3
                                    
                                     )
                                     this.data3.splice(index, 1);
                                     
                                  }else{
                                     //alert("取消");
                                     return false;
                                 }
                            }
                        }
                    }, '刪除'),
                  
                      h('Button', {
                        props: {
                            type: 'error',
                            size: 'small',
                        },
                        style: {
                            marginRight: '5px'
                        },
                        on: {
                            click: () => {
                                this.change(params);
                            }
                        }
                    }, '更多'),
                    
                       h('Dropdown',[
                               h('Button','下拉菜單'),
                               h('DropdownMenu',{
                                   props:{
                                       slot:"list"
                                   },
                               },[
                               h('DropdownItem','驢打滾'),
                               h('DropdownItem','驢打滾')
                               ])
                       
                       
                       ])
                   
                   
                   
                ]);
            }

這是render函數(shù),但是出來的效果卻是這樣的
clipboard.png
我想要的是這樣的效果

clipboard.png
職業(yè)哥該怎么做

回答
編輯回答
鹿惑

h('DropdownMenu',{

 slot:"list"

}

2017年12月22日 00:34
編輯回答
青檸

請教一下,這個效果能不能整成點(diǎn)擊下拉,然后能選擇的那種,怎么做?

2017年5月31日 20:33
編輯回答
故人嘆

鏈接失效了,樓主能說一下怎么解決的嗎

2018年8月1日 00:08
編輯回答
傲嬌范
  h('Dropdown', {
    style: {
      marginLeft: '5px'
    },
    on: {
      'on-click': (value) => {
        console.log(value)
      }
    }
  }, [
    h('div', {
      class: {
        member_operate_div: true
      }
    }, [
      h('Button', {
        props: {
          type: 'primary',
          size: 'small'
        }
      }, [
        h('span', '更多'),
        h('Icon', {
          props: {
            type: 'arrow-down-b'
          },
          style: {
            marginLeft: '5px'
          }
        })
      ])
    ]),
    h('DropdownMenu', {
      slot: 'list'
    }, [
      h('DropdownItem', {
        props: {
          name: 'edit'
        }
      }, [
        h('Button', {
          props: {
            type: 'primary',
            size: 'small'
          },
          style: {
            display: 'inline-block',
            width: '76px'
          },
          on: {
            click: () => {
              this.openEditUserDialog(params.row, params.index)
            }
          }
        }, '編輯')
      ])
    ])
  ])
2017年8月25日 11:51