We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
给了动态插槽后,同时还是作用域插槽,父组件拿不到作用域插槽的值
子组件代码:
<slot v-if="item.isCustomContent" :name="item.slotName || 'record'" :item="item" :dataItem="dataItem" :index="index"></slot> <template v-else> <view class="card-list-item-title"> {{ item.title }} : </view> <view class="card-list-item-text"> {{ dataItem[item.prop] === 0 ? "0" : dataItem[item.prop] || "-" }} </view> </template> </template> </view> </template> </view>
父组件代码: <template #distance="{ item }"> 123 --{{ item }}
这样父组件拿作用域插槽的值直接不渲染插槽了,写死123可以显示
The text was updated successfully, but these errors were encountered:
hello , 你这个问题应该出现在小程序上吧,小程序上,不支持作用于插槽https://zh.uniapp.dcloud.io/tutorial/vue3-components.html#%E5%B0%8F%E7%A8%8B%E5%BA%8F%E4%B8%8D%E6%94%AF%E6%8C%81%E5%88%97%E8%A1%A8
Sorry, something went wrong.
长时间未回复,关闭 issue,如果还存在这个问题,可以重新打开
GRCmade
No branches or pull requests
给了动态插槽后,同时还是作用域插槽,父组件拿不到作用域插槽的值
子组件代码:
父组件代码:
<template #distance="{ item }"> 123 --{{ item }}
const cardConfigHelp = reactive({
columns: [
{ title: "救援时间", prop: "time" },
{ title: "救援地点", prop: "address" },
{ title: "救援距离", prop: "distance", slotName: "distance", isCustomContent: true },
{ title: "救援费", prop: "money", isCustomContent: true }
],
isCustomTitle: true,
isCustomContent: false,
isCustomFooter: false
})
这样父组件拿作用域插槽的值直接不渲染插槽了,写死123可以显示
The text was updated successfully, but these errors were encountered: