Skip to content
New issue

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

微信小程序作用域插槽存在问题 #3986

Closed
snowchenlei opened this issue Nov 10, 2022 · 7 comments
Closed

微信小程序作用域插槽存在问题 #3986

snowchenlei opened this issue Nov 10, 2022 · 7 comments
Assignees

Comments

@snowchenlei
Copy link

问题描述
微信小程序使用作用域插槽存在问题

<!-- list-page组件 -->
	<template>
		<view>
	        <view  v-for="(item, index) in items" :key="index">
				<slot :data="item"></slot>
			</view>
		</view>
	</template>
	<!-- card组件 -->
	<template>
		<view>
	        <slot name="header"></slot>
		</view>
	</template>
	<!-- index.vue -->
	<template>
		<list-page v-slot="{data}" :items="items">
			<card @click.native="goDetail(data.id)"><!-- 微信小程序报错,data is not defined -->
				<template #header>
					<view>{{data.id}}</view><!-- 微信小程序报错,data is not defined -->
				</template>
			</card>
		</list-page>
	</template>
@xyj040303
Copy link

唉,差不多的问题,请问有解决吗?

@snowchenlei
Copy link
Author

唉,差不多的问题,请问有解决吗?

没办法,只能不用插槽。等官方支持吧

@zhetengbiji
Copy link
Collaborator

vue2还是vue3?

@snowchenlei
Copy link
Author

vue2还是vue3?

我的是2

@xyj040303
Copy link

vue2

@zhenyuWang
Copy link
Contributor

3986-vue2-weixin-for-scope-slot.zip
如上测试工程未复现该问题,请提供下测试工程,谢谢

@zhenyuWang zhenyuWang self-assigned this Mar 2, 2023
@zhetengbiji
Copy link
Collaborator

#3503

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants