node.js - 如何仅在文本框的图标上执行 vue.js 鼠标悬停事件

标签 node.js vuejs2 bulma

<b-input type="tel" placeholder="Customer Mobile No" name="contactNumber" ref="contactNumber"
          @blur="getCustomer(bill.customer.contactNumber)"
          @input="getCustomer(bill.customer.contactNumber)"
          icon="phone_android"
          tabindex="2"
          title="Customer's mobile number"
          maxlength="10" minlength="10" pattern="\d{10}" v-model="bill.customer.contactNumber"
          :disabled="isDefaultCustomer || (bill.couponDiscount > 0 || bill.giftcertificateAmount > 0 || isExchangeCustomer)" required>
        </b-input>

如何仅在 b-input 标签的 icon 属性上应用 vue.js 的 mouseover 事件

最佳答案

要捕获鼠标悬停事件,您必须将 @mouseover.native="someFunction" 传递给您的 b-input 组件

Vue.use(Buefy.default)


const example = {
  data() {
    return {
      name: 'John Silver'
    }
  },

  methods: {
    something () {
      alert('hovering over input')
    }
  }
}


const app = new Vue(example)

app.$mount('#app')
<script src="https://unpkg.com/vue@2.5.9/dist/vue.js"></script>
<link href="https://unpkg.com/buefy@0.6.3/lib/buefy.min.css" rel="stylesheet"/>
<script src="https://unpkg.com/buefy@0.6.3/lib/index.js"></script>


<div id="app" class="container">

  <section>
    <b-field label="Name" @mouseover.native="something">
      <b-input v-model="name"></b-input>
    </b-field>
  </section>

</div>

关于node.js - 如何仅在文本框的图标上执行 vue.js 鼠标悬停事件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49171867/

相关文章:

node.js - 在各种事件下自动打开串口并记录数据

javascript - res.render() 后手写笔未应用于我的 Jade 文件

vue.js - 将 v-model 添加到嵌套 v-for 循环中的输入

javascript - Vue js 动态导入组件

javascript - bool 玛卡的简单 jQuery 切换不起作用

html - bool 玛问题 : overflow when using navbar in columns

node.js - 第二个用户不创建

javascript - Yodlee Interactive - 用于身份验证的 coblogin API - 错误代码 415

javascript - 如何将 Vuex 列表中的项目传递给组件?

css - 在另一列结束后水平展开 Bulma 列