<div id="app">
<label>
Id:
<input type="text" v-model="id" />
</label>
<label>
品牌:
<input type="text" v-model="name" />
</label>
<button type="button" @click="add" v-color="'blue'">添加</button>
<br />
<label v-color>
根据品牌名称搜索:
<input type="text" v-model="search" @change="searchName"
Vue-自定义指令(获取焦点、设置字体颜色指令实例)
![](https://img-home.csdnimg.cn/images/20240711042549.png)