Skip to content

Commit

Permalink
update tutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
egoist committed Mar 31, 2019
1 parent 1881090 commit 8c8fafa
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion website/pages/tutorial/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,27 @@ plugins:
- resolve: saber-plugin-query-posts
```
Then there will be a `posts` property under the `page` prop, you can access the `page` prop from the page itself (if no layout is specified) or its layout component, you can open Vue Devtools in your browser to inspect the `page` prop:
Then tell your homepage `pages/index.vue` that it wants the post list to be injected:

```vue {highlightLines:[11]}
<template>
<div>
<h1>My Blog</h1>
<p>This is my lovely (not yet) homepage!</p>
</div>
</template>
<script>
export const attributes = {
layout: 'page',
injectAllPosts: true
}
export default {}
</script>
```

Now there will be a `posts` property under the `page` prop, you can access the `page` prop from the page itself (if no layout is specified) or its layout component, you can open Vue Devtools in your browser to inspect the `page` prop:

<img src="./images/vue-devtools-page-prop.png" class="browser-image" alt="vue-devtools-page-prop">

Expand Down

0 comments on commit 8c8fafa

Please sign in to comment.