Skip to content

Commit

Permalink
docs: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
KeJunMao committed Feb 1, 2023
1 parent 3028af1 commit 1f21f2a
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 1 deletion.
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,23 @@ export default defineConfig({
});
```

Import virtual layouts and call `app.use`

```ts
// src/main.ts
import { createSSRApp } from "vue";
import App from "./App.vue";
import UniLayouts from "virtual:uni-layouts";

export function createApp() {
const app = createSSRApp(App);
app.use(UniLayouts);
return {
app,
};
}
```

Create the layout in `src/layouts`

```vue
Expand Down
17 changes: 17 additions & 0 deletions README.zhCN.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,23 @@ export default defineConfig({
});
```

导入虚拟布局并调用 `app.use`

```ts
// src/main.ts
import { createSSRApp } from "vue";
import App from "./App.vue";
import UniLayouts from "virtual:uni-layouts";

export function createApp() {
const app = createSSRApp(App);
app.use(UniLayouts);
return {
app,
};
}
```

`src/layouts` 下创建布局

```vue
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"build": "unbuild",
"dev": "unbuild --stub",
"prepublishOnly": "pnpm build",
"release": "bumpp && npm publish",
"release": "bumpp",
"play": "nr -C playground dev:h5",
"test": "vitest"
},
Expand Down

0 comments on commit 1f21f2a

Please sign in to comment.