【问题标题】:vue3 & jsx, how to get the parameters obtained by writing and obtaining slotvue3 & jsx, 如何获取通过写获取slot得到的参数
【发布时间】:2021-04-12 19:38:49
【问题描述】:

vue3 & jsx,如何获取通过写获取slot得到的参数 代码...

// parent.jsx
//...
render() {
  return (
    <div>
      this.$slots.cell({
         msg: 'parent'
      })
    <div>

  )
}
//...

// children.jsx
//...
setup(props){
  return <div>{ props.msg }</div>
}
//...
//use.jsx
//...
render() {
  return (
    <parent>
    // How to use the slot and get the passed parameters?
    <parent>

  )
}
//...

看起来像这样How to use template scope in vue jsx?

【问题讨论】:

    标签: vue.js jsx


    【解决方案1】:

    所有内容都在自述文件中https://github.com/vuejs/jsx-next/#slot

    使用 v-slots

    【讨论】:

      猜你喜欢
      • 2021-12-11
      • 1970-01-01
      • 1970-01-01
      • 2021-12-31
      • 2021-02-23
      • 1970-01-01
      • 2018-03-13
      • 2021-12-11
      • 1970-01-01
      相关资源
      最近更新 更多