File tree 6 files changed +24
-26
lines changed
6 files changed +24
-26
lines changed Original file line number Diff line number Diff line change @@ -156,11 +156,6 @@ export default {
156
156
// }
157
157
// }
158
158
159
- listeners () {
160
- const { input , change , ... listeners } = this .$listeners ; // eslint-disable-line no-unused-vars
161
- return listeners;
162
- },
163
-
164
159
// wrapperComputedProps mixin
165
160
// isHorizontal () {
166
161
// return Boolean(this.horizontal)
Original file line number Diff line number Diff line change 3
3
description, class: computedClasses}" >
4
4
<template #input >
5
5
<input
6
+ v-on =" listeners"
6
7
v-bind =" $attrs"
7
8
:id =" safeId"
8
9
:type =" $options.type"
33
34
</template >
34
35
35
36
<script >
36
- import { safeId , validationComputedProps } from ' ./form-mixins'
37
+ import { sharedComputedProps } from ' ./form-mixins'
37
38
import { inputCheckboxProps as props } from ' ./form-props'
38
39
import CFormGroup from ' ./CFormGroup'
39
40
40
41
export default {
41
42
name: ' CInputCheckbox' ,
42
43
inheritAttrs: false ,
43
44
components: { CFormGroup },
44
- mixins: [safeId, validationComputedProps ],
45
+ mixins: [sharedComputedProps ],
45
46
props,
46
47
// {
47
48
// validFeedback: String,
Original file line number Diff line number Diff line change 15
15
<template #input >
16
16
<input
17
17
v-bind =" $attrs"
18
+ v-on =" listeners"
18
19
:id =" safeId"
19
20
:class =" inputClasses"
20
21
:multiple =" multiple"
Original file line number Diff line number Diff line change 16
16
<template #input >
17
17
<select
18
18
v-bind =" $attrs"
19
+ v-on =" listeners"
19
20
:id =" safeId"
20
21
:class =" inputClasses"
21
22
@input =" onSelect($event)"
Original file line number Diff line number Diff line change 13
13
<template #input >
14
14
<textarea
15
15
v-bind =" $attrs"
16
+ v-on =" listeners"
16
17
:id =" safeId"
17
18
:class =" inputClasses"
18
19
:readonly =" readonly || plaintext"
33
34
34
35
<script >
35
36
import CFormGroup from ' ./CFormGroup'
36
- import { textareaProps as props } from ' ./form-props'
37
+ import { textareaProps as props } from ' ./form-props'
37
38
import * as allFormMixins from ' ./form-mixins'
38
39
const mixins = Object .values (allFormMixins)
39
40
Original file line number Diff line number Diff line change 1
1
import { makeUid } from '@coreui/utils/src'
2
2
3
- export const safeId = {
3
+ export const sharedComputedProps = {
4
4
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 ( ) {
6
17
if ( this . id || this . $attrs . id ) {
7
18
return this . id || this . $attrs . id
8
19
}
9
20
return makeUid ( )
21
+ } ,
22
+ listeners ( ) {
23
+ const { input, change, ...listeners } = this . $listeners // eslint-disable-line no-unused-vars
24
+ return listeners
10
25
}
11
26
}
12
27
}
@@ -45,22 +60,6 @@ export const wrapperComputedProps = {
45
60
}
46
61
}
47
62
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
-
64
63
export const watchValue = {
65
64
watch : {
66
65
value ( val ) {
You can’t perform that action at this time.
0 commit comments