8000 Guide > Composition API > Setup の翻訳を追従 by naokie · Pull Request #283 · vuejs-jp/ja.vuejs.org · GitHub
[go: up one dir, main page]

Skip to content

Guide > Composition API > Setup の翻訳を追従 #283

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Apr 27, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Note that props can be accessed in template directly
  • Loading branch information
naokie committed Apr 26, 2021
commit 8337e023da99a6f58d872495087c32b7820d3b99
6 changes: 3 additions & 3 deletions src/guide/composition-api-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,19 +99,19 @@ export default {

## テンプレートでの使用

`setup` がオブジェクトを返す場合、コンポーネントのテンプレート内でオブジェクトのプロパティにアクセスすることができます。:
`setup` がオブジェクトを返す場合、コンポーネントのテンプレート内でオブジェクトのプロパティにアクセスすることができ、 `setup` に渡された `props` のプロパティも同じようにアクセスできます:

```vue-html
<!-- MyBook.vue -->
<template>
<div>{{ readersNumber }} {{ book.title }}</div>
<div>{{ props.collectionName }}: {{ readersNumber }} {{ book.title }}</div>
</template>

<script>
import { ref, reactive } from 'vue'

export default {
setup() {
setup(props) {
const readersNumber = ref(0)
const book = reactive({ title: 'Vue 3 Guide' })

Expand Down
0