Skip to content

Commit

Permalink
docs: 更新自动引入说明
Browse files Browse the repository at this point in the history
  • Loading branch information
markthree committed May 25, 2022
1 parent 2b08b20 commit 40dda73
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ pnpm lint:fix

## 启发 🐃

该模板受 **[vitesse](https://github.com/antfu/vitesse)** 启发,如果你有 SSG 的场景,那么推荐你始终使用 **[vitesse](https://github.com/antfu/vitesse)**
该模板受 **[vitesse](https://github.com/antfu/vitesse)** 启发,如果你有 `SSG` 的场景,那么推荐你始终使用 **[vitesse](https://github.com/antfu/vitesse)**

<br />
<br />
Expand Down Expand Up @@ -488,7 +488,7 @@ const doubled = computed(() => count.value * 2)

当然还有项目中的自动引入,只需要满足以下规范即可。

1. `src/composables` 下凡是 `use` 开头的模块,同时里边有 `default` 导出,该导出就可以被按需自动引入
1. `src/composables` 的导出将被按需自动引入

例如有个 `src/composables/foo.ts`

Expand All @@ -509,7 +509,7 @@ export default 1000
</template>
```

2. `src/stores` 下凡是 `Store` 结尾的模块,同时里边有 `default` 导出,该导出就可以按需自动引入
1. `src/stores` 的导出将被按需自动引入

例如有个 `src/stores/counterStore.ts`

Expand Down Expand Up @@ -541,7 +541,7 @@ export default defineStore('counter', {
</template>
```

具体可见 👉 [unplugin-auto-import](https://github.com/antfu/unplugin-auto-import)[vite-auto-import-resolvers](https://github.com/dishait/vite-auto-import-resolvers)
具体可见 👉 [unplugin-auto-import](https://github.com/antfu/unplugin-auto-import)

<br />

Expand Down

0 comments on commit 40dda73

Please sign in to comment.