一、VUE中的遗漏的知识
render中的h函数 h函数可以创建虚拟dom,通过创建的虚拟dom再转化为真的的DOM,从而渲染到页面中。 <script> // render function // template -> render -> h -> 虚拟DOM(JS对象)-> 真实 DOM -> 展示到页面上 const app = Vue.createApp({ template: ` <my-title :level="2"> hello xiaokang </my-title> ` }) app.component('my-title', { props: ['level'], render() { const { h } = Vue return h('h' + this.level, {}, [ this.$slots.default(), h('h4', {}, 'xiao ...