【发布时间】:2017-09-27 21:27:02
【问题描述】:
我这样定义一个简单的子组件(testSlot.vue):
<template>
<section>
<div>this is title</div>
<slot text="hello from child slot"></slot>
</section>
</template>
<script>
export default {}
</script>
我们可以像这样在html模板中使用它
<test-slot>
<template scope="props">
<div> {{props.text}}</div>
<div> this is real body</div>
</template>
</test-slot>
但是如何在 jsx 中使用它呢?
【问题讨论】: