File tree Expand file tree Collapse file tree 3 files changed +21
-2
lines changed Expand file tree Collapse file tree 3 files changed +21
-2
lines changed Original file line number Diff line number Diff line change 11<template >
22 <div class =" component-based" >
33 <div class =" title" >Component</div >
4- <VueNumber v-bind =" config" v-model =" price" />
4+ <VueNumber @input = " onInput " @change = " onChange " @blur = " onBlur " v-bind =" config" v-model =" price" />
55 <div >Price: {{ price }}</div >
66 <div >Calculated: {{ calculated }}</div >
77 </div >
88</template >
99
1010<script >
11+ import { InputMixin } from ' ../mixins'
12+
1113export default {
14+ mixins: [InputMixin],
1215 data () {
1316 return {
1417 price: 123456.86 ,
Original file line number Diff line number Diff line change 11<template >
22 <div class =" directive-based" >
33 <div class =" title" >Directive</div >
4- <input v-number =" config" v-model =" price" />
4+ <input @input = " onInput " @change = " onChange " @blur = " onBlur " v-number =" config" v-model =" price" />
55 <div >Price: {{ price }}</div >
66 <div >Calculated: {{ calculated }}</div >
77 </div >
88</template >
99
1010<script >
11+ import { InputMixin } from ' ../mixins'
12+
1113export default {
14+ mixins: [InputMixin],
1215 data () {
1316 return {
1417 price: 123456.86 ,
Original file line number Diff line number Diff line change 1+ export const InputMixin = {
2+ methods : {
3+ onChange ( ) {
4+ console . log ( 'onChange' , arguments )
5+ } ,
6+ onInput ( ) {
7+ console . log ( 'onInput' , arguments )
8+ } ,
9+ onBlur ( ) {
10+ console . log ( 'onBlur' , arguments )
11+ }
12+ }
13+ }
You can’t perform that action at this time.
0 commit comments