Vuejs.org: Add documentation for $createElement() to the API docs

Created on 15 Dec 2016  路  7Comments  路  Source: vuejs/vuejs.org

I don't see anywhere vm.$createElement being mentioned in the docs It's not a private function, right? judging from this comment

2.0 enhancement

Most helpful comment

Why hasn't this been documented yet?

All 7 comments

Hm ... It's not a private function really, no.

It probably slipped through because the only real use for it is in the render function, to which it is passed as the argument anyway:

https://vuejs.org/v2/api/#render

But it might be worth documenting.

the only real use for it is in the render function, to which it is passed as the argument anyway:

Agree, but sometimes render logic can be very complex so it's useful to move some of the code to the custom method function. Then you have 2 choices, a) pass the createElement from the render down to the method or b) just use this.$createElement

Some third party plugins are using this API : see element-ui

It would be great to document it - just found out about it on accident. Very useful helper for JS based components

Why hasn't this been documented yet?

I searching why Vuetify use "this.$createElement" without jsx babel, and now finding the why!

The documentation is missing this attribute. u.u

Was this page helpful?
0 / 5 - 0 ratings

Related issues

richardtallent picture richardtallent  路  4Comments

ankitsinghaniyaz picture ankitsinghaniyaz  路  4Comments

bencooper222 picture bencooper222  路  3Comments

estyh picture estyh  路  5Comments

daymos picture daymos  路  4Comments