简体   繁体   English

材料设计在失焦时添加芯片

[英]Material-design add chip when out of focus

I am currently using vue materials.我目前正在使用 vue 材料。 Needs to add functionality that when the user is "focusout" the chip is automatically added like in angular materials: https://material.angular.io/components/chips/overview需要添加功能,当用户“聚焦”时,芯片会像角材料一样自动添加: https ://material.angular.io/components/chips/overview

Here you can test how it works in vue materials (user have to push enter to add)在这里你可以测试它在 vue 材料中是如何工作的(用户必须按回车添加)

https://vuematerial.io/components/chips https://vuematerial.io/components/chips

There is a function in vue materials "insertChip" but I have no idea how to call it or is it possible at all? vue 材料“insertChip”中有一个函数,但我不知道如何调用它,或者有可能吗? https://github.com/vuematerial/vue-material/blob/dev/src/components/MdChips/MdChips.vue https://github.com/vuematerial/vue-material/blob/dev/src/components/MdChips/MdChips.vue

Expected effect, but any way of invoking this function will be good:预期效果,但任何调用此函数的方式都会很好:

<md-chips
  class="md-primary" 
  @blur="insertChip"
  v-model="model">
</md-chips>

Thanks for any help.谢谢你的帮助。

They have implemented the "Auto Insert" boolean prop in the last months ( md-auto-insert ), you can just call it like stated on the official page :他们在过去几个月中实现了“自动插入”布尔属性( md-auto-insert ),您可以像官方页面上所述那样称呼它:

<md-chips
  class="md-primary" 
  :md-auto-insert="true"
  v-model="model">
</md-chips>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM