



Rendering
Vue2中的render function
render(h) {return h('div', {attrs: {id: 'foo'},on: {click: this.onClick}, 'hello')}
Vue3中的render function
<!--Vue 3 API* Flat props structure* Globally imported `h` helper-->import { h } from 'vue'render() {return h('div', {id: 'foo',onClick: this.onClick}, 'hello')}
:::info 对于h函数中第二个参数所传递的扁平化对象中,Vue会check这个key 是否已经作为属性存在于原生DOM节点中的(比如上面例子中的id)。如果存在,那么会设置为property, 如果不存在,就设置为一个attribute :::
