Skip to content

improve passing-props translation #1184

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 2 commits into from
Feb 22, 2017
Merged

improve passing-props translation #1184

merged 2 commits into from
Feb 22, 2017

Conversation

kazupon
Copy link
Member

@kazupon kazupon commented Feb 22, 2017

original:
Try to keep the props function stateless, as it's only evaluated on route changes. Use a wrapper component if you need state to define the props, that way vue can react to state changes.

see: https://router.vuejs.org/en/essentials/passing-props.html

@kazupon kazupon requested review from ktsn and tejitak February 22, 2017 08:20
@@ -65,7 +65,6 @@ const router = new VueRouter({

url `/search?q=vue` は `{query: "vue"}` をプロパティとして SearchUser コンポーネントに渡します。

ルート変更時にのみ評価されるため、プロパティの機能はステートレスにしてください。
ラッパーコンポーネントを使用すると、状態を変更して状態を変更することができます。
ルート変更時にのみ評価されるため、props 関数はステートレスにしてください。プロパティを定義するために状態を必要とする場合は、その方法で vue は状態変更に対応することができます。
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use a wrapper component に対応する文章がないように見えます。

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

あ、失敬。orz ...
修正しました!

@kazupon kazupon merged commit 48ec733 into vuejs:dev Feb 22, 2017
@kazupon kazupon deleted the improve/ja branch February 22, 2017 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants