vue el table實現自定義表頭

2021-09-26 14:31:53 字數 2599 閱讀 7701

el-table可以通過設定 scoped slot 來實現自定義表頭。

文件說明如下:

**實現:

width=

"50%"

:visible.sync=

"isshow"

:before-close=

"beforeclose"

title=

"自定義裝置型別屬性"

>

="dialogdiv"

>

:data=

"tabledata.filter(data => handleadd || data.name.tolowercase().includes(handleadd.tolowercase()))"

style=

"width: 100%" border>

"code"

:label=

"$t('basicdata.device.propdlg.code')"

>

<

/el-table-column>

"maxvalue"

:label=

"$t('basicdata.device.propdlg.maxvalue')"

>

<

/el-table-column>

"minvalue"

:label=

"$t('basicdata.device.propdlg.minvalue')"

>

<

/el-table-column>

"name"

:label=

"$t('basicdata.device.propdlg.name')"

>

<

/el-table-column>

"valuetype"

:label=

"$t('basicdata.device.propdlg.valuetype')"

>

<

/el-table-column>

"warning"

:label=

"$t('basicdata.device.propdlg.warning')"

>

<

/el-table-column>

"center" width=

"160px"

>

"header" slot-scope=

"scope"

>

"handleadd"

size=

"mini"

type=

"success"

circle plain

icon=

"el-icon-plus"

@click=

"handleadd(scope.$index, scope.row)"

>

<

/el-button>

<

/template>

"scope"

>

size=

"mini"

type=

"primary"

circle plain

icon=

"el-icon-edit"

@click=

"handleedit(scope.$index, scope.row)"

>

<

/el-button>

size=

"mini"

type=

"danger"

circle plain

icon=

"el-icon-delete"

@click=

"handledelete(scope.$index, scope.row)"

>

<

/el-button>

<

/template>

<

/el-table-column>

<

/el-table>

<

/div>

"footer"

>

"cancel"

>

}<

/el-button>

"confirm" type=

"primary"

>

}<

/el-button>

<

/span>

<

/el-dialog>

<

/template>

export

default},

methods:

,// 編輯

handleedit

(index, row)

,// 刪除

handledelete

(index, row)

,cancel()

,confirm()

}};<

/script>

自定義Toast實現自定義Toast布局

平時我們使用toast的時候都是這樣的一種方法 toast toast toast.maketext context,duration 現在我們來自定義下toast的布局,首先看下toast建立時的源 public static toast maketext context context,char...

實現自定義IFormattable

using system using system.collections using system.linq using system.text using system.collections.generic using system.runtime.serialization namespac...

自定義tabcontrol實現

using system using system.collections generic using system.drawing using system.linq using system.text using system.windows forms namespace shengxinso...