Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin only works in theme-teadocs? #1

Open
Nemo1166 opened this issue Oct 17, 2022 · 4 comments
Open

Plugin only works in theme-teadocs? #1

Nemo1166 opened this issue Oct 17, 2022 · 4 comments

Comments

@Nemo1166
Copy link

I'm using vuepress-theme-hope, and when I tried using this plugin, it didn't work. I have read the source code, and found that there are some keywords like "... teadocs ...". Is this plugin available in theme-teadocs only? How can I use it in another theme?

我在调用插件时并未生效,阅读了 vue SFC 源码,您的插件似乎仅在使用 teadocs 主题时有效。如果我想将其应用在其他主题应当做何修改?

@wuwb
Copy link
Owner

wuwb commented Oct 21, 2022

See if the configuration is written in the wrong place, it needs to be written under defineUserConfig and not passed into the plugin. I didn't look into the details of how the plugin reads the configuration, but found that it worked just fine, so I didn't look deeper.

The teadocs keyword is just an identifier used to store notification status information in localstorage. It has nothing to do with the vuepress-theme-teadocs theme, which has the plugin built in by default. This plugin is a by-product of the development of that theme.

看下是不是配置写错地方了,配置需要写在 defineUserConfig 下,而不是传入插件。当时没有详细研究插件如何读取配置,发现这样写也能跑通,就没有深入去看了。

teadocs 关键词只是用来在 localstorage 中存储 通知状态信息时候的标识。和 vuepress-theme-teadocs 主题没有关系,vuepress-theme-teadocs 主题默认内置了该插件。这个插件是开发那款主题的副产物。

@Nemo1166
Copy link
Author

image

我确实把配置写在 defineUserConfig ,但也确实没有生效。而且 TS 检查报告 alert 不能作为配置的 key。

@binggandata
Copy link

image

我确实把配置写在 defineUserConfig ,但也确实没有生效。而且 TS 检查报告 alert 不能作为配置的 key。

遇到了同样的问题,请问解决了吗?

@zhanglinweigithub
Copy link

同样的问题,我是用的是 vuepress-theme-hope 主题,根据README文档操作报错如下
image
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants