导出定义的store时是用export const还是export default(whether to use export const or export default when exporting a defined store)) #2376
Unanswered
SilentFlute
asked this question in
Help and Questions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
文档中提到: "你可以定义任意多的 store,但为了让使用 pinia 的益处最大化(比如允许构建工具自动进行代码分割以及 TypeScript 推断),你应该在不同的文件中去定义 store。" -> 使用 Store
示例代码是这样的:
既然应该在不同的文件中去定义store, 那导出语句为何不使用
export default
呢?the doc said: "You can define as many stores as you want and you should define each store in a different file to get the most out of Pinia (like automatically allowing your bundler to code split and providing TypeScript inference)." -> Using the store
the sample code looks like this:
since you should define each store in a different file, why not use
export default
for the export statement?Beta Was this translation helpful? Give feedback.
All reactions