优化TDK数据获取逻辑和空值处理
This commit is contained in:
@ -5,7 +5,7 @@ export default defineNuxtRouteMiddleware(async (to) => {
|
|||||||
// 获取当前路由
|
// 获取当前路由
|
||||||
const currentPath = to.path;
|
const currentPath = to.path;
|
||||||
// 根据当前路由获取对应的TDK数据
|
// 根据当前路由获取对应的TDK数据
|
||||||
const currentTdk = tdkData.find((item) => item.path === currentPath)
|
const currentTdk = tdkData?.find((item) => item.path === currentPath)
|
||||||
|
|
||||||
if (currentTdk) {
|
if (currentTdk) {
|
||||||
useHead({
|
useHead({
|
||||||
|
|||||||
Reference in New Issue
Block a user