【发布时间】:2022-10-13 08:36:27
【问题描述】:
我在导航栏中有一个将被呈现的项目列表。每个项目都应该有一个与其名称相关的链接。因为我不想对链接进行硬编码,所以我不知道如何命名链接。
<b-nav-item-dropdown no-caret class="mr-2">
<!-- Using 'button-content' slot -->
<template #button-content>
<div><b-icon icon="person-fill"></b-icon> {{ userItems[0] }}</div>
</template>
<b-dropdown-item
v-for="(userItem, index) in userItems[1]"
:key="index"
:to="userItem"
>
{{ userItem }}
</b-dropdown-item>
</b-nav-item-dropdown>
:to="{name: userItem }" 也不起作用。
【问题讨论】:
-
有什么错误吗?
标签: vuejs2 bootstrap-vue