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

鍍金池/ 問答/HTML/ vue用iview table組件,如何在column里面調(diào)用click?

vue用iview table組件,如何在column里面調(diào)用click?

我把iview的table組件和page組件封裝了成了一個component。然后column數(shù)據(jù)從一個static目錄里面導(dǎo)出到頁面,data數(shù)據(jù)是存的url從后端取出,

export const appRegistDetail={
  "size":'small',
  "detailClick":false,
  "columns" : [
    {
      type: 'index',
      key: 'id',
      width: 60,
      fixed: 'left',
    },
    {
      title: '使用單位名稱',
      key: 'useComName',
      fixed: 'left',
      width: 135,
    },
   
    {
      title: '發(fā)證日期',
      key: 'sendRegistDate',
      width: 125,
    },

    {
      title: '使用登記證編號',
      key: 'registCode',
      width: 150,
    },
    {
      title: '操作',
      key: 'state',
      fixed: 'right',
      width: 120,
      render: (h, params) => {
        return h('div', [
          h('Button', {
            props: {
              type: 'primary',
            },
            style: {
              marginRight: '5px',
            },
            on: {
              click: () => {
                console.log(params.index)
                //this.appDetail(params.index);
                appRegistDetail.detailClick=true;
                appRegistDetail.index=params.index;

              }
            }
          }, '詳情'),

        ]);


      }

    },
  ],
  "data" : {
    url:'/admin/approvedApplies/get',
    methods:'post',
    params:{
      'size':10,
    }
  }
}

這有一個問題就是我沒辦法像iview文檔里面那樣,在click那里設(shè)置一個函數(shù),訪問data了。
我現(xiàn)在想實現(xiàn)最后一欄能跳轉(zhuǎn)到一個新頁面。求幫忙

回答
編輯回答
近義詞

你問題看得我蛋疼,不過差不多就是這樣了

{
                                title: 'Action',
                                key: 'action',
                                width: 150,
                                align: 'center',
                                render: (h, params) => {
                                    return h('div',
                                        h('Button', {
                                            props: {
                                                type: 'info',
                                                size: 'small'
                                            },
                                            on: {
                                                click: () => {
                                                    console.log(params)
                                                    //在這里定義跳轉(zhuǎn)動作,params里有你想要的信息
                                                }
                                            }
                                        }, '跳轉(zhuǎn)')
                                    );
                                }
                            }
2017年9月10日 05:17