Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
569 views
in Technique[技术] by (71.8m points)

vue.js - vue3 & jsx, how to get the parameters obtained by writing and obtaining slot

vue3 & jsx, how to get the parameters obtained by writing and obtaining slot code...

// 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>

  )
}
//...

Looks like thisHow to use template scope in vue jsx?.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

It's all here in the readme https://github.com/vuejs/jsx-next/#slot

use v-slots


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...