Skip to content

Commit 149c6c6

Browse files
committed
refactor: remove listners function from form-mixins
1 parent 7eaec17 commit 149c6c6

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

src/components/form/CInput.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,10 @@ export default {
106106
// }
107107
// },
108108
computed: {
109+
listeners () {
110+
const { input, change, ...listeners } = this.$listeners // eslint-disable-line no-unused-vars
111+
return listeners
112+
}
109113
// classesComputedProps mixin
110114
// haveCustomSize () {
111115
// return ['sm','lg'].includes(this.size)

src/components/form/CTextarea.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,10 @@ export default {
100100
// }
101101
// },
102102
computed: {
103+
listeners () {
104+
const { input, change, ...listeners } = this.$listeners // eslint-disable-line no-unused-vars
105+
return listeners
106+
}
103107
// classesComputedProps mixin
104108
// haveCustomSize () {
105109
// return ['sm','lg'].includes(this.size)

src/components/form/form-mixins.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,22 @@ import { makeUid } from '@coreui/utils/src'
22

33
export const sharedComputedProps = {
44
computed: {
5-
computedIsValid() {
5+
computedIsValid () {
66
if (typeof this.isValid === 'function') {
77
return this.isValid(this.state)
88
}
99
return this.isValid
1010
},
11-
validationClass() {
11+
validationClass () {
1212
if (typeof this.computedIsValid === 'boolean') {
1313
return this.computedIsValid ? 'is-valid' : 'is-invalid'
1414
}
1515
},
16-
safeId() {
16+
safeId () {
1717
if (this.id || this.$attrs.id) {
1818
return this.id || this.$attrs.id
1919
}
2020
return makeUid()
21-
},
22-
listeners () {
23-
const { input, change, ...listeners } = this.$listeners // eslint-disable-line no-unused-vars
24-
return listeners
2521
}
2622
}
2723
}

0 commit comments

Comments
 (0)