Skip to content

Commit 5819a1e

Browse files
committed
doc: update development doc
1 parent 8347a16 commit 5819a1e

File tree

1 file changed

+11
-17
lines changed

1 file changed

+11
-17
lines changed

README.md

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ Vite plugin for vue Server-Side Rendering, Used express to create a server.
77
## Usage
88

99
```ts
10-
import routes from './routes'
1110
import { ViteSSR } from 'vite-ssr-vue3'
11+
import routes from './routes'
1212
import App from './App.vue'
1313

14-
export const createApp = ViteSSR(App, { routes }, context => {
14+
export const createApp = ViteSSR(App, { routes }, (context) => {
1515
const { app, initialState } = context
1616

1717
// if (import.meta.env.SSR) {
@@ -23,11 +23,11 @@ export const createApp = ViteSSR(App, { routes }, context => {
2323
// Use pinia to store your data
2424
const pinia = createPinia()
2525

26-
if (import.meta.env.SSR) {
26+
if (import.meta.env.SSR)
2727
initialState.pinia = pinia.state.value
28-
} else {
28+
29+
else
2930
pinia.state.value = initialState.pinia
30-
}
3131

3232
// do something
3333
})
@@ -43,18 +43,12 @@ const counts = await useFetch('counts', () => Promise.resolve([1, 2, 3]))
4343

4444
## Development
4545

46-
use `example/basic` to start development.
47-
48-
```powershell
49-
# Install root and workspace
50-
pnpm install
51-
# Install package to root
52-
pnpm install <package> -w
53-
# Install package to workspace's basic
54-
pnpm -F basic install <package>
55-
# Run dev
56-
pnpm example:dev
57-
```
46+
There are some examples in the **example** directory, you can execute the **package.json** script to start developing source with the sample.
47+
48+
First, you should install the dependencies with command `pnpm install`, then run the `pnpm basic:dev` command to start developing, run `pnpm basic:serve` to view production environment effects.
49+
50+
+ `example/basic`: Basic usage with data fetching example
51+
+ `example/naive-ui`: Naive UI example
5852

5953
## Thanks
6054

0 commit comments

Comments
 (0)