We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1.10.3
No response
<template lang="pug"> t-layout t-header t-head-menu(v-model="activeRoute") t-menu-item(value="foo") | Foo t-layout t-aside Aside t-content slot t-footer Footer </template> <script lang="ts" setup> import { ref } from "vue"; const activeRoute = ref("foo"); </script>
正常使用
报了如下 warning
[Vue warn]: Property "$router" was accessed during render but is not defined on instance.
我们业务场景围绕 ruby on rails 和 inertia.js,所以不需要 vue-router 组件。现在情况会报 vue warn,虽然不影响使用,但满屏幕的 warning 挺影响调试的。
问题来自
tdesign-vue-next/src/menu/menu-item.tsx
Line 74 in af68adb
RouterLink
一个 workaround 是手动传入 menu-item(:router="{}")。
menu-item(:router="{}")
The text was updated successfully, but these errors were encountered:
👋 @dsh0416,感谢给 TDesign 提出了 issue。 请根据 issue 模版确保背景信息的完善,我们将调查并尽快回复你。
Sorry, something went wrong.
fix(menu): do not eagerly access $router in rendering
$router
d82a823
corresponding to: Tencent#4718
No branches or pull requests
tdesign-vue-next 版本
1.10.3
重现链接
No response
重现步骤
期望结果
正常使用
实际结果
报了如下 warning
框架版本
No response
浏览器版本
No response
系统版本
No response
Node版本
No response
补充说明
我们业务场景围绕 ruby on rails 和 inertia.js,所以不需要 vue-router 组件。现在情况会报 vue warn,虽然不影响使用,但满屏幕的 warning 挺影响调试的。
问题来自
tdesign-vue-next/src/menu/menu-item.tsx
Line 74 in af68adb
RouterLink
,此处也会 eagerly 初始化 router 变量。可以通过某种方法改成惰性的。一个 workaround 是手动传入
menu-item(:router="{}")
。The text was updated successfully, but these errors were encountered: