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

抖音小程序使用原生组件slot时指定name无法生效 #17211

Open
JankingW opened this issue Jan 22, 2025 · 0 comments
Open

抖音小程序使用原生组件slot时指定name无法生效 #17211

JankingW opened this issue Jan 22, 2025 · 0 comments

Comments

@JankingW
Copy link

相关平台

字节跳动小程序

复现仓库

https://github.com/JankingW/taro-slot-sample.git
小程序基础库: 3.52.0.11
使用框架: React

复现步骤

  1. 原生组件中指定slot name:
无子节点时会显示当前备用内容 2. 使用时,指定Slot组件的name: {/* @ts-ignore */} 这是current {/* @ts-ignore */} {/* @ts-ignore */}

期望结果

能正常展示Slot组件里的内容到原生组件slot中

实际结果

无法展示Slot内容

环境信息

👽 Taro v4.0.8

(node:91291) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)

  Taro CLI 4.0.8 environment info:
    System:
      OS: macOS 15.2
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 21.5.0 - /usr/local/bin/node
      Yarn: 1.22.22 - /usr/local/bin/yarn
      npm: 10.2.4 - /usr/local/bin/npm
    npmPackages:
      @tarojs/cli: 4.0.8 => 4.0.8 
      @tarojs/components: 4.0.8 => 4.0.8 
      @tarojs/helper: 4.0.8 => 4.0.8 
      @tarojs/plugin-framework-react: 4.0.8 => 4.0.8 
      @tarojs/plugin-platform-alipay: 4.0.8 => 4.0.8 
      @tarojs/plugin-platform-h5: 4.0.8 => 4.0.8 
      @tarojs/plugin-platform-harmony-hybrid: 4.0.8 => 4.0.8 
      @tarojs/plugin-platform-jd: 4.0.8 => 4.0.8 
      @tarojs/plugin-platform-qq: 4.0.8 => 4.0.8 
      @tarojs/plugin-platform-swan: 4.0.8 => 4.0.8 
      @tarojs/plugin-platform-tt: 4.0.8 => 4.0.8 
      @tarojs/plugin-platform-weapp: 4.0.8 => 4.0.8 
      @tarojs/react: 4.0.8 => 4.0.8 
      @tarojs/runtime: 4.0.8 => 4.0.8 
      @tarojs/shared: 4.0.8 => 4.0.8 
      @tarojs/taro: 4.0.8 => 4.0.8 
      @tarojs/taro-loader: 4.0.8 => 4.0.8 
      @tarojs/webpack5-runner: 4.0.8 => 4.0.8 
      babel-preset-taro: 4.0.8 => 4.0.8 
      eslint-config-taro: 4.0.8 => 4.0.8 
      react: ^18.0.0 => 18.3.1 
    npmGlobalPackages:
      typescript: 5.6.2

补充信息

该仓库提交了最小复现的代码:https://github.com/JankingW/taro-slot-sample.git。
其中有两个提交:
一个提交是指定了slot的title,将无法展示Slot内容。
另一个提交去掉了slot的title,将可以展示Slot内容。

This was referenced Jan 25, 2025
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

1 participant