rax icon indicating copy to clipboard operation
rax copied to clipboard

[Question]

Open lmfjt opened this issue 3 years ago • 2 comments

插槽指令使用出错 // 组件Carousel <View className="carousel" ref={scrollbar}> {children} </View>

// 使用组件Carousel <Carousel> <View x-slot:carousel="progress" className="carousel-container"> <View>{progress}</View> </View> </Carousel>

找不到名称“progress”。你是否指的是“onprogress”?ts(2552) lib.dom.d.ts(17618, 13): 在此处声明了 "onprogress"。

请问哪一步出错了,我需要作用域插槽

lmfjt avatar Jul 22 '22 09:07 lmfjt

// 组件Carousel <View className="carousel" ref={scrollbar}> <slot x-bind:progress={progress} name="carousel">{children}</slot> </View> // 使用组件Carousel <Carousel> <View x-slot:carousel="progress" className="carousel-container"> <View>{progress}到底啦~~~~~~</View> </View> </Carousel>

lmfjt avatar Jul 22 '22 09:07 lmfjt

现在的问题是我对供了作用域插槽 progress ,但在外部无法使用着这个数据

lmfjt avatar Jul 22 '22 09:07 lmfjt