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

35 lines
668 B
Vue
Raw 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-numeric v-model="value" @input="onInput"></tiny-numeric>
<div>
input事件触发了:<span class="count">{{ inputCount }}</span> 次
</div>
</div>
</template>
<script lang="ts">
import { TinyModal, TinyNumeric } from '@opentiny/vue'
export default {
components: {
TinyNumeric
},
data() {
return {
value: 1,
inputCount: 0
}
},
methods: {
onInput(event: InputEvent) {
const currentValue = (event.target as HTMLInputElement).value
TinyModal.message({
message: `新值 ${currentValue}`,
status: 'info'
})
this.inputCount++
}
}
}
</script>