Replies: 2 comments
-
Executing npm run build is normal in preview, only dev has this problem |
Beta Was this translation helpful? Give feedback.
0 replies
-
将key 从 Symbol 替换成不同字符串, 可正常使用 const AsyncCurrentPageIndexSymbol: InjectionKey<Ref<number>> = Symbol('current-page-index');
provide(AsyncCurrentPageIndexSymbol, currentPageIndex);
inject<Ref<number>>(AsyncCurrentPageIndexSymbol)!
// 改为
provide('AsyncCurrentPageIndexSymbol', currentPageIndex);
inject<Ref<number>>('AsyncCurrentPageIndexSymbol')! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
When customizing the theme, a variable was injected in layout via provide, which I used correctly when using it locally. But after I publish the theme package to npm, it will prompt 'injection "Symbol(current-page-index)" not found.'.
自定义主题时, 在 layout 中通过 provide 注入了一个变量, 我在本地使用时是可以正确使用的. 但是我将主题包发布到npm 后, 通过 npm 按照无法正常使用会提示
injection "Symbol(current-page-index)" not found.
.github url source code
The main branch is the source code
bug_demo is a minimal restore demo
Executing npm run dev will result in the following error
Beta Was this translation helpful? Give feedback.
All reactions