Skip to content

Commit

Permalink
docs: README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
jizai1125 committed Aug 1, 2024
1 parent 5ad582f commit 12dd40f
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,30 @@ import CountUp from 'vue-countup-v3'
```
</details>


### SSR 中使用

<details>
<summary><strong>Vite</strong></summary>

需在 vite.config.ts 中添加配置,将 vue-countup-v3 加入 ssr.noExternal 配置中,让 vite 不视为外部依赖,将依赖包含在 SSR 的打包中,避免出现问题。

```ts
import { defineConfig } from 'vite'

export default defineConfig({
// ...
ssr: {
noExternal: ['vue-countup-v3']
}
})

```

</details>

<details>
<summary><strong>Nuxt 中使用(usage in Nuxt)</strong></summary>
<summary><strong>Nuxt</strong></summary>

需在 nuxt.config.ts 中添加配置

Expand All @@ -139,7 +161,7 @@ export default defineNuxtConfig({
</details>

<details>
<summary><strong>Astro 中使用(usage in Astro)</strong></summary>
<summary><strong>Astro</strong></summary>

需要在组件上加个指令 `client:only`

Expand Down

0 comments on commit 12dd40f

Please sign in to comment.