-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
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
如何动态切换tab标题 #256
Comments
这只是一种情况,可能还有很多情况都是不同的路由,指向的页面组件是同一个。这个时候改怎么处理tab标题和页面标题呢 |
推荐用这种方式,将页面内容抽离出一个组件,然后分别引入到编辑和新增的页面。 |
谢谢,我也这样考虑过,并且需要多个路由指向的view,感觉有些麻烦。 |
之前上了国际化的功能,所以Tab这里优先用了国际化的文本,所以设置Tab标题的不起作用了 |
好的,明白了,非常感谢~~ |
* main: (103 commits) perf(hooks): perf useHookTable feat(hooks): add useHookTable fix(projects): correct the lang file name & add recommend vscode plugin i18n-ally feat(projects): new i18n function $t & login page and setting drawer config i18n chore(projects): correct the word spell chore(projects): update VSCode setting chore(projects): update pnpm-lock.yaml chore(deps): update deps fix(styles): 用户管理页面布局自适应屏幕高度 (fixed soybeanjs#253) feat(auth): 防止多次刷新token chore(projects): update deps & fix eslint code chore(projects): update package.json chore(deps): update deps docs(projects): update README.md logo chore(projects): update deps and fix swiper refactor(projects): 生产环境缓存主题变更为sessionStorage style(projects): update default theme color fix(projects): fix set tab title (fixed soybeanjs#256) chore(deps): update deps chore(deps): update deps ... # Conflicts: # .env # build/plugins/index.ts # src/views/component/card/index.vue
很感谢 soybean-admin,模块思路都很清晰,已经尝试在使用了。现在出现了一个小问题,请教下作者。
需求是这样的:
有些页面组件是新增和编辑都可以同时使用同一页面组件的,由于当前走的文件路由,路由name和path的枚举都已经自动生成,所以不好自定义,想在想在进入改页面时,在 onMounted 通过 route 的 query 来判断是否是那种操作,来通过改变 route.meta 来动态更新 tab 的标题 和 页面标题显示,示例:
可是并不能通过该方法得到想要的结果。
也尝试使用
useTabStore().setActiveTabTitle(title)
来更新,结果也不是想要的(这个貌似不起任何作用)。The text was updated successfully, but these errors were encountered: