邓洁 : 修复bug
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="manage-btn">
|
||||
<div v-for="(item,index) in btnList" :key="item.name" class="btn-box" @click="select(index)">
|
||||
<div v-for="(item,index) in btnList" :key="item.name" class="btn-box" @click="select(item,index)">
|
||||
<div :style="{ backgroundImage:'url(' +getImageUrl(item.icon)+')' }"></div>
|
||||
<div :class="{'select-active':selectButton===index}">{{ item.name }}</div>
|
||||
</div>
|
||||
@@ -60,10 +60,10 @@ const selectButton = ref(props.modelValue);
|
||||
const getImageUrl = (name) => {
|
||||
return new URL(`../../assets/images/topAndDown/${name}`, import.meta.url).href
|
||||
}
|
||||
const select = (index) => {
|
||||
const select = (item,index) => {
|
||||
if (selectButton.value === index) return;
|
||||
selectButton.value = index;
|
||||
emit("update:modelValue", index);
|
||||
emit("select", index);
|
||||
emit("select", item.name);
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user