Open 2290774104 opened 3 days ago
vuepress-theme-hope
使用文档提供的命令创建项目后,在 theme.ts 中的 searchPro 配置 indexContent: true 时,搜索中文会导致页面报错,但 config.ts 中配置则可以正常搜索
theme.ts
indexContent: true
config.ts
pnpm create vuepress-theme-hope my-docs pnpm add -D vuepress-plugin-search-pro
// theme.ts export default hopeTheme({ plugins: { searchPro: { indexContent: true; } } })
这是在 theme.ts 中配置后搜索出现的错误
// config.ts import { searchProPlugin } from 'vuepress-plugin-search-pro'; export default defineUserConfig({ plugins: [ searchProPlugin({ indexContent: true }), ] })
这是在 config.ts 中配置的搜索成功
开发环境: node v18.20.3 npm 10.7.0 pnpm 9.4.0 项目依赖版本 "@vuepress/bundler-vite": "2.0.0-rc.14", "vue": "^3.4.27", "vuepress": "2.0.0-rc.14", "vuepress-plugin-search-pro": "2.0.0-rc.50", "vuepress-theme-hope": "2.0.0-rc.50"
Checklist
Package name
vuepress-theme-hope
Which operating system are you using?
Describe the bug
使用文档提供的命令创建项目后,在
theme.ts
中的 searchPro 配置indexContent: true
时,搜索中文会导致页面报错,但config.ts
中配置则可以正常搜索这是在![theme.ts配置报错](https://github.com/vuepress-theme-hope/vuepress-theme-hope/assets/72640061/1bbd8d2b-f0d0-46ba-acaa-bfd0c87d624c)
theme.ts
中配置后搜索出现的错误这是在![config.ts配置后成功](https://github.com/vuepress-theme-hope/vuepress-theme-hope/assets/72640061/742c19a0-cfef-44c7-8c90-8aa75f2fc9a5)
config.ts
中配置的搜索成功Additional context
开发环境: node v18.20.3 npm 10.7.0 pnpm 9.4.0 项目依赖版本 "@vuepress/bundler-vite": "2.0.0-rc.14", "vue": "^3.4.27", "vuepress": "2.0.0-rc.14", "vuepress-plugin-search-pro": "2.0.0-rc.50", "vuepress-theme-hope": "2.0.0-rc.50"