我想隐藏组件中的插槽,并在安装组件时也显示该插槽。 index.blade.php 索引.vue 更新 我有一些其他类型的插槽正在工作: index.blade.php 索引.vue 但我不知道如何用顶部的插槽来做。 ...
提示:本站收集StackOverFlow近2千万问答,支持中英文搜索,鼠标放在语句上弹窗显示对应的参考中文或英文, 本站还提供 中文繁体 英文版本 中英对照 版本,有任何建议请联系yoyou2525@163.com。
我需要我的组件来获取插槽号被父组件占用
例如:
这是组件:
<template>
<div>
<slot/>
</div>
</template>
<script>
name: 'comp',
data() {
return {
nslot: 0
}
}
</script>
这是家长
<template>
<div>
<component>
<button slot=""></button>
<component/>
</div>
</template>
<script>
name: 'comp'
</script>
我该怎么办? 我想在“nslot”变量中获取已使用插槽的数量
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.