Skip to content

[Doc]: Updates render function tip with note about h #1451

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 1 commit into from
Feb 3, 2019
Merged
Changes from all commits
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
4 changes: 2 additions & 2 deletions src/v2/guide/render-function.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: 描画関数とJSX
updated: 2019-01-20
updated: 2019-02-03
type: guide
order: 303
---
Expand Down Expand Up @@ -494,7 +494,7 @@ new Vue({
})
```

<p class="tip">`createElement` を `h` にエイリアスしていることは、 Vue のエコシステムの中でよく見かける慣習です。そして、それは実は JSX には必須です。もし `h` がそのスコープ内で利用可能でない場合、アプリケーションはエラーを throw するでしょう。</p>
<p class="tip">`createElement` を `h` にエイリアスしていることは、 Vue のエコシステムの中でよく見かける慣習です。そして、それは実は JSX には必須です。Vue の Babel プラグインの [バージョン 3.4.0](https://github.com/vuejs/babel-plugin-transform-vue-jsx#h-auto-injection) 以降では、ES2015 のシンタックスで宣言された JSX を含むメソッドや getter(関数やアロー関数は対象外)に対しては、自動的に `const h = this.$createElement` が注入されるため、`(h)` パラメーターは省略できます。それ以前のバージョンでは、もし `h` がそのスコープ内で利用可能でない場合、アプリケーションはエラーを throw するでしょう。</p>

より詳しい JSX の JavaScript へのマップの仕方については、[usage ドキュメント](https://github.com/vuejs/jsx#installation) をご参照ください。

Expand Down