Skip to content

Commit 74fea05

Browse files
committed
fix: 左侧边栏的内拦使用 href
1 parent a0039f0 commit 74fea05

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/pages/home/components/LeftBar.vue

+9-4
Original file line numberDiff line numberDiff line change
@@ -215,20 +215,25 @@ onMounted(() => {
215215
</div>
216216
<Transition name="menu">
217217
<ul class="py-[3px] flex nav-container" v-show="item1.show">
218-
<span
219-
@click="toUrl(item2.link)"
218+
<a
219+
@click.prevent="toUrl(item2.link)"
220220
v-for="item2 in item1.children"
221221
:key="item2.title"
222+
:href="item2.link"
222223
:class=" { 'bg-[#dcdcdc]': $route.path.trim().startsWith(item2.link.trim()) }"
223-
class="leading-4 navitem-flex hover:bg-[#dcdcdc] cursor-pointer pr-[10px] pl-[16px] block text-wrap select-none"
224-
>{{ item2.title }}</span>
224+
class="leading-4 navitem-flex hover:bg-[#dcdcdc] cursor-pointer pr-[10px] pl-[16px] block text-wrap select-none href-noline"
225+
>{{ item2.title }}</a>
225226
</ul>
226227
</Transition>
227228
</div>
228229
</div>
229230
</template>
230231

231232
<style scoped>
233+
.href-noline {
234+
text-decoration: none;
235+
}
236+
232237
.menu-enter-active {
233238
overflow-y: hidden;
234239
animation: menuslide-in .15s linear;

0 commit comments

Comments
 (0)