mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-09 00:42:36 +00:00
Refactor #3965 - Refactor on DataTable Column index context
This commit is contained in:
parent
6cbe5735b8
commit
9cb888b6a0
6 changed files with 66 additions and 55 deletions
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<div :class="cx('checkboxWrapper')" @click="onClick" v-bind="getColumnPTOptions('checkboxWrapper')">
|
||||
<div :class="cx('hiddenInputWrapper')" :style="sx('hiddenAccessible', isUnstyled)" v-bind="getColumnPTOptions('hiddenInputWrapper')" :data-p-hidden-accessible="true">
|
||||
<div :class="cx('checkboxWrapper')" @click="onClick" v-bind="getColumnPT('checkboxWrapper')">
|
||||
<div :class="cx('hiddenInputWrapper')" :style="sx('hiddenAccessible', isUnstyled)" v-bind="getColumnPT('hiddenInputWrapper')" :data-p-hidden-accessible="true">
|
||||
<input
|
||||
ref="input"
|
||||
type="checkbox"
|
||||
|
@ -11,12 +11,12 @@
|
|||
@focus="onFocus($event)"
|
||||
@blur="onBlur($event)"
|
||||
@keydown="onKeydown"
|
||||
v-bind="getColumnPTOptions('hiddenInput')"
|
||||
v-bind="getColumnPT('hiddenInput')"
|
||||
/>
|
||||
</div>
|
||||
<div ref="box" :class="cx('checkbox')" v-bind="getColumnPTOptions('checkbox')">
|
||||
<div ref="box" :class="cx('checkbox')" v-bind="getColumnPT('checkbox')">
|
||||
<component v-if="rowCheckboxIconTemplate" :is="rowCheckboxIconTemplate" :checked="checked" :class="cx('checkboxIcon')" />
|
||||
<CheckIcon v-else-if="!rowCheckboxIconTemplate && !!checked" :class="cx('checkboxIcon')" v-bind="getColumnPTOptions('checkboxIcon')" />
|
||||
<CheckIcon v-else-if="!rowCheckboxIconTemplate && !!checked" :class="cx('checkboxIcon')" v-bind="getColumnPT('checkboxIcon')" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -37,6 +37,10 @@ export default {
|
|||
rowCheckboxIconTemplate: {
|
||||
type: Function,
|
||||
default: null
|
||||
},
|
||||
index: {
|
||||
type: Number,
|
||||
default: null
|
||||
}
|
||||
},
|
||||
data() {
|
||||
|
@ -45,7 +49,7 @@ export default {
|
|||
};
|
||||
},
|
||||
methods: {
|
||||
getColumnPTOptions(key) {
|
||||
getColumnPT(key) {
|
||||
return this.ptmo(this.getColumnProp(), key, {
|
||||
props: this.column.props,
|
||||
parent: {
|
||||
|
@ -53,6 +57,7 @@ export default {
|
|||
state: this.$data
|
||||
},
|
||||
context: {
|
||||
index: this.index,
|
||||
checked: this.checked,
|
||||
focused: this.focused,
|
||||
disabled: this.$attrs.disabled
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue