路由器链接与 vue 和 vuetify 混淆 [英] router-link with vue and vuetify confusion

查看:43
本文介绍了路由器链接与 vue 和 vuetify 混淆的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用 vue-router 使用该预定义模板:

How to use vue-router with using that predefined template:

https://vuetifyjs.com/examples/layouts/google-contacts

我在我的物品对象中添加了一个链接

I have added a link in my items object

 items: 
[{ icon: 'dashboard' text: 'Home', link: '/'},

{ icon: 'dashboard' text: 'Account', link: '/account'},

我很困惑在哪里放置路由器链接组件.

I am confused where to put the router-link component.

推荐答案

v-list-tilev-btnv-card 都扩展了 router-link,因此您可以直接在这些组件上使用任何 router-link 属性.

v-list-tile, v-btn, and v-card all extend router-link, so you can use any of the router-link attributes directly on those components instead.

在您的情况下,您可以使用 <v-list-tile :to="item.link">

In your case you can just use <v-list-tile :to="item.link">

这篇关于路由器链接与 vue 和 vuetify 混淆的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆