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
微信小程序
https://github.com/kaixuanzhou/taro-test-build-plugin.git 小程序基础库: 3.4.0 使用框架: React
在插件中导出一个自定义组件,用官方文档中的写法,尝试对插件中的组件进行配置多插槽模式时失效
使用taro仓库中的build-weapp-plugin示例,简单改造即可重现 component:
export default class Avatar extends Component { static options = { multipleSlots: true, } render () { return ( <View > <Text>slot 1:</Text> <NativeSlot name='slot1' /> <Text>slot 2:</Text> <NativeSlot name='slot2' /> </View> ) } }
page:
export default class Index extends Component { render () { return ( <View className='index'> {/** 测试插件组件 */} <avatar> <Slot name='slot1'>测试slot1</Slot> <Slot name='slot2'>测试slot2</Slot> </avatar> </View> ) } }
能正常使用多插槽模式
多插槽无效,改成单插槽模式可显示
build-weapp-plugin@1.0.0 info > taro info 👽 Taro v3.6.24 Taro CLI 3.6.24 environment info: System: OS: macOS 12.1 Shell: 5.8 - /bin/zsh Binaries: Node: 16.20.2 - /opt/homebrew/opt/nvm/versions/node/v16.20.2/bin/node Yarn: 1.22.17 - /opt/homebrew/bin/yarn npm: 8.19.4 - /opt/homebrew/opt/nvm/versions/node/v16.20.2/bin/npm npmPackages: @tarojs/cli: 3.6.24 => 3.6.24 @tarojs/components: 3.6.24 => 3.6.24 @tarojs/plugin-framework-react: 3.6.24 => 3.6.24 @tarojs/react: 3.6.24 => 3.6.24 @tarojs/runtime: 3.6.24 => 3.6.24 @tarojs/taro: 3.6.24 => 3.6.24 @tarojs/webpack5-runner: 3.6.24 => 3.6.24 babel-preset-taro: 3.6.24 => 3.6.24 eslint-config-taro: 3.6.24 => 3.6.24 react: ^18.0.0 => 18.2.0 npmGlobalPackages: typescript: 5.4.5
有尝试在源码中定位问题,发现:taro/native-component.js中读取组件的config未获取到
The text was updated successfully, but these errors were encountered:
No branches or pull requests
相关平台
微信小程序
复现仓库
https://github.com/kaixuanzhou/taro-test-build-plugin.git
小程序基础库: 3.4.0
使用框架: React
复现步骤
在插件中导出一个自定义组件,用官方文档中的写法,尝试对插件中的组件进行配置多插槽模式时失效
使用taro仓库中的build-weapp-plugin示例,简单改造即可重现
component:
page:
期望结果
能正常使用多插槽模式
实际结果
多插槽无效,改成单插槽模式可显示
环境信息
补充信息
有尝试在源码中定位问题,发现:taro/native-component.js中读取组件的config未获取到
The text was updated successfully, but these errors were encountered: