Vue练习三十三:04_06_当前输入框高亮显示

Demo 在线地址:
https://sx00xs.github.io/test/33/index.html
---------------------------------------------------------------
ide: vscode
文件格式:.vue
解析:(待补)

<template>
    <form>
        <h2>用户登录</h2>
        <p>
            <label>用户名:</label>
            <input type="text"  @focus="handleFocus" @blur="handleBlur" class="f-text">
        </p>
        <p>
            <label>密码:</label>
            <input type="password" class="f-text" @focus="handleFocus" @blur="handleBlur" >
        </p>
        <p><label></label><input class="f-btn" type="button" value="登录"></p>
    </form>
</template>
<script>
export default {
    methods:{
        handleFocus(event){
            event.target.className='f-text-high'
        },
        handleBlur(event){
            event.target.className='f-text'
        }
    }
}
</script>
原文地址:https://www.cnblogs.com/sx00xs/p/11266189.html