dewfall123 / vitepress-for-component

📖 针对组件开发的VitePress。 重构版本https://github.com/dewfall123/ruabick
https://dewfall123.github.io/vitepress-for-component/
MIT License
194 stars 38 forks source link

npm run dev 报错 #42

Closed MaybeQHL closed 2 years ago

MaybeQHL commented 2 years ago

关键代码: const decodedHtmlStr = computed(() => decodeURIComponent(props.htmlStr ?? "")); 报错信息: Uncaught SyntaxError: Unexpected token ?

dewfall123 commented 2 years ago

你是怎么使用的呢? 提供下复现步骤

使用文档

MaybeQHL commented 2 years ago

[谷歌浏览器正常,QQ浏览器报错

image 拉下来代码直接运行

MaybeQHL commented 2 years ago

如果我要自己编写一个测试用的组件 image 如何全局注册

dewfall123 commented 2 years ago

如何全局注册

自定义主题,在theme文件里能注册

https://github.com/dewfall123/vitepress-for-component/blob/master/docs/.vitepress/theme/index.js

MaybeQHL commented 2 years ago

好的谢谢

MaybeQHL commented 2 years ago

另外再问下代码片段可否定义主题颜色。

dewfall123 commented 2 years ago

可以这样引入css https://vitepress.vuejs.org/guide/theming.html#customizing-css

然后覆盖这里的样式 https://github.com/dewfall123/vitepress-for-component/blob/master/src/client/theme-default/styles/code.css