Vue监听input输入框

2020-06-01 10:39:50 浏览数 (1)

代码语言:javascript复制
<template>
<input v-model="initial" v-on:input="change"></input>
</template>

<script>
export default {
name: "test",
data: () => ({
initial: "Initial Value"
}),
methods: {
change() {
console.log(this.initial)
}
}
};
</script>

0 人点赞