The render function in vuejs passes scope slots to the subcomponents.

vuejs official website tutorial:
ide/render-function.html-sharp%E6%8F%92%E6%A7%BD" rel=" nofollow noreferrer "> slot

if you want to use the rendering function to pass scope slots to the subcomponents, you can take advantage of the scopedSlots field in the VNode data object:

render: function (createElement) {
  return createElement("div", [
    createElement("child", {
      //  `scopedSlots`
      // :{ name: props => VNode | Array<VNode> }
      scopedSlots: {
        default: function (props) {
          return createElement("span", props.text)
        }
      }
    })
  ])
}

how do you understand this? I don"t know how to debug even if I don"t give a demo, on the official website, especially what the "child" is? How do I register this "child" subcomponent when rendering a template with the render function? Ask the great god to explain, it is best to demo the whole online.

Aug.11,2021
Menu