1.子组件中
<view> <slot :user="user">{{user.lastName}}</slot> </view>
2.在父组件使用
<template v-slot:default="otherSlotProps"> {{ otherSlotProps.user.firstName }} </template>
此时在编译到微信小程序中报错
而运行到其他环境下比如H5是没问题的
那么在微信小程序中要使用解构插槽方式实现:
<template v-slot:default="{user}"> {{ user.firstName }} </template>
标签:slot,插槽,解构,报错,user,otherSlotProps From: https://www.cnblogs.com/yusilu-2653144/p/17210685.html