我创建了一个新的v-select组件,该组件具有由项目标题和两个按钮组成的选择行。当选择项目或用户单击某些按钮时,我该如何处理?
我将@click包含在按钮中,但是当单击时,选中了项目并同时调用了@click函数
<v-select
:items="props.item.featureLevels"
v-model="editedItem.feature_level_id"
item-value="id"
chips
label="Select level"
solo>
<template v-slot:prepend-item>
<v-list-tile
ripple
@click="editFeature(featureProp.item.feature_level, true, 'Add new
feature level')">
<v-list-tile-content>
<v-btn flat small color="primary">Add new</v-btn>
</v-list-tile-content></v-list-tile>
<v-divider class="mt-2"></v-divider>
</template>
<template v-slot:item="data">
<span>{{ `${data.item.index} ${data.item.title}`}}</span>
<v-icon
small
class="ma-2"
@click="editFeature(featureProp.item.feature_level, true, 'Edit feature level')">
edit
</v-icon>
<v-icon
small
class="ma-2"
@click="editFeature(featureProp.item.feature_level, true, 'Edit feature level')">
delete
</v-icon>
</template>
<template v-slot:selection="data">
<span>{{ `${data.item.index} ${data.item.title}`}}</span>
</template>
</v-select>
https://ibb.co/VVN3mwL-它-我拥有的