@blur 当失去鼠标的时候激发
<template>
<div>
<div>
<input type="text" placeholder="请输入内容" @blur="blurInfo"/>
</div>
</div>
</template>
<script>
export default {
name: "info",
methods:{
blurInfo(){
console.log("blur事件被执行了")
}
}
}
</script>
@focus
<style scoped>
</style>
<template>
<div>
<div>
<input type="text" placeholder="请输入内容" @focus="focusInfo"/>
</div>
</div>
</template>
<script>
export default {
name: "info",
methods:{
focusInfo(){
console.log("focus事件被执行了")
}
}
}
</script>
<style scoped>
</style>
<template>
<div>
<div>
<input type="text" placeholder="请输入内容" @input="inputInfo"/>
</div>
</div>
</template>
<script>
export default {
name: "info",
methods:{
inputInfo(){
console.log("input事件被执行了")
}
}
}
</script>
<style scoped>
</style>
<template>
<div>
<div>
<button type="infoo" placeholder="请输入内容" @click="clickInfo">按钮</button>
</div>
</div>
</template>
<script>
export default {
name: "info",
methods:{
clickInfo(){
console.log("click事件被执行了")
}
}
}
</script>
<style scoped>
</style>
@change当输入框失焦的时候触发 如单选框框改变状态的时候就会触发
@close当关闭(窗口,按钮等)时事件触发