This repository was archived by the owner on Oct 17, 2022. It is now read-only.
File tree 2 files changed +6
-16
lines changed 2 files changed +6
-16
lines changed Original file line number Diff line number Diff line change 120
120
cardNumber: null ,
121
121
phoneNumber: null ,
122
122
date: null ,
123
- number: null ,
123
+ number: 1234567 ,
124
124
},
125
125
// https://github.com/nosir/cleave.js/blob/master/doc/options.md
126
126
options: {
Original file line number Diff line number Diff line change 1
1
<template >
2
- <input :type =" type" v-bind = " $attrs " v-on = " inputListeners " >
2
+ <input :type =" type" @blur = " onBlur " >
3
3
</template >
4
4
5
5
<script >
6
6
import Cleave from ' cleave.js'
7
7
8
8
export default {
9
9
name: ' cleave' ,
10
- inheritAttrs: false ,
11
10
props: {
12
11
value: {
13
12
default: null ,
26
25
type: Boolean ,
27
26
default: true
28
27
},
28
+ // Input type, for example `tel`
29
29
type: {
30
30
type: String ,
31
31
default: ' text'
74
74
this .onValueChangedFn .call (this , event )
75
75
}
76
76
},
77
+ onBlur (event ) {
78
+ this .$emit (' blur' , this .value )
79
+ }
77
80
},
78
81
watch: {
79
82
/**
107
110
this .cleave .setRawValue (newValue);
108
111
}
109
112
},
110
- computed: {
111
- inputListeners () {
112
- return Object .assign ({},
113
- // Add all the listeners from the parent
114
- this .$listeners ,
115
- {
116
- blur : (event ) => {
117
- this .$emit (' blur' , this .value )
118
- }
119
- }
120
- )
121
- }
122
- },
123
113
/**
124
114
* Free up memory
125
115
*/
You can’t perform that action at this time.
0 commit comments