tiny-vue/examples/sites/demos/pc/app/numeric/change-event.vue

35 lines
671 B
Vue
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<div>
<tiny-button @click="clickChange">修改</tiny-button>
<br /><br />
<tiny-numeric :change-compat="false" v-model="value" @change="onChange"></tiny-numeric>
</div>
</template>
<script lang="ts">
import { Numeric, Modal, Button } from '@opentiny/vue'
export default {
components: {
TinyNumeric: Numeric,
TinyButton: Button
},
data() {
return {
value: 1
}
},
methods: {
onChange(newVal: number, oldVal: number) {
Modal.message({
message: '新值' + newVal + '旧值' + oldVal,
status: 'info'
})
},
clickChange() {
this.value = 22
}
}
}
</script>