[{"data":1,"prerenderedAt":368},["ShallowReactive",2],{"toc-zh-\u002Fappendix\u002Ffaq":3,"page-zh-\u002Fappendix\u002Ffaq":236},{"id":4,"title":5,"body":6,"description":228,"extension":229,"meta":230,"navigation":231,"path":232,"seo":233,"stem":234,"__hash__":235},"content_zh\u002Fappendix\u002Ffaq.md","常见问题",{"type":7,"value":8,"toc":211},"minimark",[9,14,18,47,51,68,72,79,83,104,108,121,125,137,141,151,155,161,165,176,180,186,190,193,197,200,204],[10,11,13],"h2",{"id":12},"页面显示-code-原文而不是翻译后的文字","页面显示 code 原文而不是翻译后的文字",[15,16,17],"p",{},"可能原因：",[19,20,21,30,37],"ol",{},[22,23,24,25,29],"li",{},"字典数据还没加载完成。确保在 ",[26,27,28],"code",{},"v-if=\"data\""," 条件下使用 translate",[22,31,32,33,36],{},"字典类型名写错了。确认 ",[26,34,35],{},"useDict('gender')"," 中的类型名和后端接口返回的一致",[22,38,39,40,43,44],{},"API 接口地址配置不对。检查 ",[26,41,42],{},"dict.api.baseURL"," 和 ",[26,45,46],{},"dict.api.dictEndpoint",[10,48,50],{"id":49},"usedict-返回的-data-是-null","useDict 返回的 data 是 null",[15,52,53,56,57,60,61,43,64,67],{},[26,54,55],{},"data"," 初始值就是 ",[26,58,59],{},"null","，组件挂载后异步加载。用 ",[26,62,63],{},"loading",[26,65,66],{},"error"," 判断当前状态。",[10,69,71],{"id":70},"如何手动刷新字典","如何手动刷新字典？",[15,73,74,75,78],{},"调用 composable 返回的 ",[26,76,77],{},"refresh()"," 函数。",[10,80,82],{"id":81},"切换语言后字典没变","切换语言后字典没变？",[15,84,85,88,89,92,93,92,96,98,99,103],{},[26,86,87],{},"setLocale()"," 会清空内存缓存，使用 ",[26,90,91],{},"useDict"," \u002F ",[26,94,95],{},"useDictTree",[26,97,91],{}," 的组件会",[100,101,102],"strong",{},"自动重新加载","对应语言的字典数据，无需手动刷新或额外写 watch 代码。",[10,105,107],{"id":106},"如何与-nuxtjsi18n-一起使用","如何与 @nuxtjs\u002Fi18n 一起使用？",[15,109,110,111,114,115,120],{},"两个模块通过共享同一个 cookie（默认 ",[26,112,113],{},"i18n_redirected","）自动同步语言。页面刷新或运行时切换语言，字典数据都会自动更新。详见 ",[116,117,119],"a",{"href":118},"\u002Fintegration\u002Fi18n","i18n 国际化","。",[10,122,124],{"id":123},"如何对接已有后端接口","如何对接已有后端接口？",[15,126,127,128,132,133,136],{},"使用 ",[116,129,131],{"href":130},"\u002Fadvanced\u002Fcustom-adapter","自定义适配器","，在 ",[26,134,135],{},"api.adapter"," 中转换后端数据格式。",[10,138,140],{"id":139},"如何对接多个后端字典源","如何对接多个后端字典源？",[15,142,127,143,132,147,150],{},[116,144,146],{"href":145},"\u002Fadvanced\u002Fmulti-store","多仓库",[26,148,149],{},"dict.stores"," 中为每个数据源配置独立 API 端点。",[10,152,154],{"id":153},"indexeddb-报错怎么办","IndexedDB 报错怎么办？",[15,156,157,158,120],{},"IndexedDB 写入失败不影响功能。常见原因：隐私模式、空间不足。可设置 ",[26,159,160],{},"cache.indexedDB.enabled: false",[10,162,164],{"id":163},"字典数据更新了但页面还是旧的","字典数据更新了但页面还是旧的？",[19,166,167,170],{},[22,168,169],{},"确保后端版本号接口返回了新的版本号",[22,171,172,173,175],{},"调用 ",[26,174,77],{}," 强制刷新",[10,177,179],{"id":178},"code-是数字但-translate1-返回原文","code 是数字，但 translate(1) 返回原文",[15,181,182,183,185],{},"模块内部统一转字符串比较。检查后端返回的 ",[26,184,26],{}," 确实是数字类型。",[10,187,189],{"id":188},"ssr-预取配置了但不生效","SSR 预取配置了但不生效？",[15,191,192],{},"预取仅 SSR 模式下生效。SPA 模式不需要预取配置。",[10,194,196],{"id":195},"服务端报错-fetch-is-not-defined","服务端报错 \"fetch is not defined\"",[15,198,199],{},"确保运行环境 Node.js >= 22（Nuxt 4 要求）。",[10,201,203],{"id":202},"dicttranslatepath-返回-code-原文","$dict.translatePath 返回 code 原文",[15,205,206,207,210],{},"可能原因：不是树形字典（",[26,208,209],{},"tree"," 字段为空）、数据还没加载、树中不存在该 code。",{"title":212,"searchDepth":213,"depth":213,"links":214},"",2,[215,216,217,218,219,220,221,222,223,224,225,226,227],{"id":12,"depth":213,"text":13},{"id":49,"depth":213,"text":50},{"id":70,"depth":213,"text":71},{"id":81,"depth":213,"text":82},{"id":106,"depth":213,"text":107},{"id":123,"depth":213,"text":124},{"id":139,"depth":213,"text":140},{"id":153,"depth":213,"text":154},{"id":163,"depth":213,"text":164},{"id":178,"depth":213,"text":179},{"id":188,"depth":213,"text":189},{"id":195,"depth":213,"text":196},{"id":202,"depth":213,"text":203},"使用字典模块时遇到的最常见问题及解决方法。","md",{},true,"\u002Fappendix\u002Ffaq",{"title":5,"description":228},"appendix\u002Ffaq","ik9Xmcvu9mNltUFfQAxXq6aqA4vb1ElvhB0F3PeZQZo",{"id":4,"title":5,"body":237,"description":228,"extension":229,"meta":366,"navigation":231,"path":232,"seo":367,"stem":234,"__hash__":235},{"type":7,"value":238,"toc":351},[239,241,243,259,261,271,273,277,279,291,293,299,301,307,309,315,317,321,323,331,333,337,339,341,343,345,347],[10,240,13],{"id":12},[15,242,17],{},[19,244,245,249,253],{},[22,246,24,247,29],{},[26,248,28],{},[22,250,32,251,36],{},[26,252,35],{},[22,254,39,255,43,257],{},[26,256,42],{},[26,258,46],{},[10,260,50],{"id":49},[15,262,263,56,265,60,267,43,269,67],{},[26,264,55],{},[26,266,59],{},[26,268,63],{},[26,270,66],{},[10,272,71],{"id":70},[15,274,74,275,78],{},[26,276,77],{},[10,278,82],{"id":81},[15,280,281,88,283,92,285,92,287,98,289,103],{},[26,282,87],{},[26,284,91],{},[26,286,95],{},[26,288,91],{},[100,290,102],{},[10,292,107],{"id":106},[15,294,110,295,114,297,120],{},[26,296,113],{},[116,298,119],{"href":118},[10,300,124],{"id":123},[15,302,127,303,132,305,136],{},[116,304,131],{"href":130},[26,306,135],{},[10,308,140],{"id":139},[15,310,127,311,132,313,150],{},[116,312,146],{"href":145},[26,314,149],{},[10,316,154],{"id":153},[15,318,157,319,120],{},[26,320,160],{},[10,322,164],{"id":163},[19,324,325,327],{},[22,326,169],{},[22,328,172,329,175],{},[26,330,77],{},[10,332,179],{"id":178},[15,334,182,335,185],{},[26,336,26],{},[10,338,189],{"id":188},[15,340,192],{},[10,342,196],{"id":195},[15,344,199],{},[10,346,203],{"id":202},[15,348,206,349,210],{},[26,350,209],{},{"title":212,"searchDepth":213,"depth":213,"links":352},[353,354,355,356,357,358,359,360,361,362,363,364,365],{"id":12,"depth":213,"text":13},{"id":49,"depth":213,"text":50},{"id":70,"depth":213,"text":71},{"id":81,"depth":213,"text":82},{"id":106,"depth":213,"text":107},{"id":123,"depth":213,"text":124},{"id":139,"depth":213,"text":140},{"id":153,"depth":213,"text":154},{"id":163,"depth":213,"text":164},{"id":178,"depth":213,"text":179},{"id":188,"depth":213,"text":189},{"id":195,"depth":213,"text":196},{"id":202,"depth":213,"text":203},{},{"title":5,"description":228},1782551378091]