File tree Expand file tree Collapse file tree 6 files changed +24
-26
lines changed Expand file tree Collapse file tree 6 files changed +24
-26
lines changed Original file line number Diff line number Diff line change @@ -156,11 +156,6 @@ export default {
156156 // }
157157 // }
158158
159- listeners () {
160- const { input , change , ... listeners } = this .$listeners ; // eslint-disable-line no-unused-vars
161- return listeners;
162- },
163-
164159 // wrapperComputedProps mixin
165160 // isHorizontal () {
166161 // return Boolean(this.horizontal)
Original file line number Diff line number Diff line change 33 description, class: computedClasses}" >
44 <template #input >
55 <input
6+ v-on =" listeners"
67 v-bind =" $attrs"
78 :id =" safeId"
89 :type =" $options.type"
3334</template >
3435
3536<script >
36- import { safeId , validationComputedProps } from ' ./form-mixins'
37+ import { sharedComputedProps } from ' ./form-mixins'
3738import { inputCheckboxProps as props } from ' ./form-props'
3839import CFormGroup from ' ./CFormGroup'
3940
4041export default {
4142 name: ' CInputCheckbox' ,
4243 inheritAttrs: false ,
4344 components: { CFormGroup },
44- mixins: [safeId, validationComputedProps ],
45+ mixins: [sharedComputedProps ],
4546 props,
4647 // {
4748 // validFeedback: String,
Original file line number Diff line number Diff line change 1515 <template #input >
1616 <input
1717 v-bind =" $attrs"
18+ v-on =" listeners"
1819 :id =" safeId"
1920 :class =" inputClasses"
2021 :multiple =" multiple"
Original file line number Diff line number Diff line change 1616 <template #input >
1717 <select
1818 v-bind =" $attrs"
19+ v-on =" listeners"
1920 :id =" safeId"
2021 :class =" inputClasses"
2122 @input =" onSelect($event)"
Original file line number Diff line number Diff line change 1313 <template #input >
1414 <textarea
1515 v-bind =" $attrs"
16+ v-on =" listeners"
1617 :id =" safeId"
1718 :class =" inputClasses"
1819 :readonly =" readonly || plaintext"
3334
3435<script >
3536import CFormGroup from ' ./CFormGroup'
36- import { textareaProps as props } from ' ./form-props'
37+ import { textareaProps as props } from ' ./form-props'
3738import * as allFormMixins from ' ./form-mixins'
3839const mixins = Object .values (allFormMixins)
3940
Original file line number Diff line number Diff line change 11import { makeUid } from '@coreui/utils/src'
22
3- export const safeId = {
3+ export const sharedComputedProps = {
44 computed : {
5- safeId ( ) {
5+ computedIsValid ( ) {
6+ if ( typeof this . isValid === 'function' ) {
7+ return this . isValid ( this . state )
8+ }
9+ return this . isValid
10+ } ,
11+ validationClass ( ) {
12+ if ( typeof this . computedIsValid === 'boolean' ) {
13+ return this . computedIsValid ? 'is-valid' : 'is-invalid'
14+ }
15+ } ,
16+ safeId ( ) {
617 if ( this . id || this . $attrs . id ) {
718 return this . id || this . $attrs . id
819 }
920 return makeUid ( )
21+ } ,
22+ listeners ( ) {
23+ const { input, change, ...listeners } = this . $listeners // eslint-disable-line no-unused-vars
24+ return listeners
1025 }
1126 }
1227}
@@ -45,22 +60,6 @@ export const wrapperComputedProps = {
4560 }
4661}
4762
48- export const validationComputedProps = {
49- computed : {
50- computedIsValid ( ) {
51- if ( typeof this . isValid === 'function' ) {
52- return this . isValid ( this . state )
53- }
54- return this . isValid
55- } ,
56- validationClass ( ) {
57- if ( typeof this . computedIsValid === 'boolean' ) {
58- return this . computedIsValid ? 'is-valid' : 'is-invalid'
59- }
60- }
61- }
62- }
63-
6463export const watchValue = {
6564 watch : {
6665 value ( val ) {
You can’t perform that action at this time.
0 commit comments