【发布时间】:2019-02-07 13:27:32
【问题描述】:
要理解我的问题,请查看以下伪代码:
<my-tooltip-wrapper>
<some-slot-content />
</my-tooltip-wrapper
MyTooltipWrapper 包含来自包的TooltipComponent。但是,这需要另一个插槽来显示我的<some-slot-content />
要查看使用旧语法的this as an example,请查看并尝试使用新语法。
在插槽语法更改之前,我可以像这样使用它:
//inside of MyTooltipWrapper
<tooltip-component>
<slot
name="reference"
slot="reference"
/>
</tooltip-component>
但是,您将如何将其更改为新语法?我试过了,但没有用:
<template #reference>
<slot
name="reference"
/>
</template>
【问题讨论】:
-
我看到了你的例子,它正在工作。
-
@roliroli 抱歉造成误会,本例使用旧语法,请尝试使用新语法...
-
我认为该错误已通过以下方式修复:github.com/vuejs/vue/commit/…
标签: vue.js