为什么 v-on:change 不起作用但 v-on:input 在 vuexy 模板中有效?

问题描述 投票:0回答:1

在 vuexy 模板中,为什么在 v-select v-on:change 中不起作用?这里 loadSelectedSourceLeads 从 api 返回一个数组并正常工作。

<b-col cols="2">
          <v-select
            v-model="filterSourceId"
            :options="filterSourceIdOption"
            v-on:change="loadSelectedSourceLeads"
            :reduce="(source) => source.id"
            label="name"
            placeholder="Filter By Source"
          />
</b-col>
<script>
 methods: {
    loadSelectedSourceLeads(a) {
      console.log(a);
    },
}
</script>

但是当我使用 v-on:input 时,它会工作并返回选定的源 ID。

<b-col cols="2">
          <v-select
            v-model="filterSourceId"
            :options="filterSourceIdOption"
            v-on:input="loadSelectedSourceLeads"
            :reduce="(source) => source.id"
            label="name"
            placeholder="Filter By Source"
          />
</b-col>
<script>
 methods: {
    loadSelectedSourceLeads(a) {
      console.log(a);
    },
}
</script>
vue.js responsive-design frontend vuex
1个回答
0
投票

v-模型 = :value + @input;

这是v-select组件的实现造成的

内部应该触发了input事件,但是没有触发change事件

© www.soinside.com 2019 - 2024. All rights reserved.