fuc-new/doc/node_modules/@vuepress/plugin-reading-time/lib/client/index.js
hellcat 6adbc04d4b 1
2025-10-03 17:17:08 +08:00

3 lines
733 B
JavaScript

import{computed as t}from"vue";import{usePage as _}from"vuepress/client";import{useLocale as g}from"@vuepress/helper/client";const i=()=>{const e=_();return t(()=>e.value.readingTime??null)},u=(e,o)=>{const{minutes:r,words:s}=e,{less1Minute:m,word:c,time:d}=o;return{time:r<1?m:d.replace("$time",Math.round(r).toString()),words:c.replace("$word",s.toString())}},a={words:"",time:""},n=typeof __READING_TIME_LOCALES__>"u"?null:__READING_TIME_LOCALES__,l=()=>n?g(n):t(()=>null),p=()=>{if(n===null)return t(()=>a);const e=i(),o=l();return t(()=>e.value&&o.value?u(e.value,o.value):a)};export{u as getReadingTimeLocale,i as useReadingTimeData,p as useReadingTimeLocale,l as useReadingTimeLocaleConfig};
//# sourceMappingURL=index.js.map