亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如何在 vue-tables-2 中動態填充 listColumns?

如何在 vue-tables-2 中動態填充 listColumns?

胡說叔叔 2021-11-12 10:50:33
假設我有一個通過 prop 提供的類別名稱數組。在vue-tables-2 中,如何category在listColumns選項中動態填充過濾器?listColumns: {  type: [{    id: 1,    text: 'User'  },  {    id: 2,    text: 'Admin'  }],  category: function () {    this.categories.map((cat, index) => { return { id: index, text: cat } })  }}這樣做會返回以下錯誤:[Vue warn]: Error in render: "TypeError: _this.opts.listColumns[column].filter is not a function"
查看完整描述

1 回答

?
侃侃無極

TA貢獻2051條經驗 獲得超10個贊

您可以在選項中插入道具。


options: {

  filterByColumn: true,

    listColumns: {

        type: this.categories

    }

}


查看完整回答
反對 回復 2021-11-12
  • 1 回答
  • 0 關注
  • 174 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號