taro 飞书小程序模板无法识别 Form 和 Label 标签

h5qlskok  于 2023-02-04  发布在  其他
关注(0)|答案(4)|浏览(213)

相关平台

飞书小程序

复现仓库

git@github.com:Gino2333/FerishuTaroTest.git

使用框架: React

复现步骤

使用 taro cli 创建飞书小程序项目后,向页面 index.tsx 中添加 Form 标签和 Label 标签
例如下文

<View className='index'>
        <Text>Hello world!</Text>
        <Form>
          <Label>测试</Label>
        </Form>
      </View>

期望结果

正常展示 Form 和 Label

实际结果

未定义的模板 (tmpl_0_21) in base // 实际是 Form,并且在 base.ttml 中是 tmpl_0_20
未定义的模板 (tmpl_0_24) in base // 实际是 Label,并且在 base.ttml 中是 tmpl_0_23

环境信息

👽 Taro v3.5.8

  Taro CLI 3.5.8 environment info:
    System:
      OS: macOS 10.15.7
      Shell: 5.7.1 - /bin/zsh
    Binaries:
      Node: 14.19.2 - ~/.nvm/versions/node/v14.19.2/bin/node
      Yarn: 1.22.19 - ~/.nvm/versions/node/v14.19.2/bin/yarn
      npm: 9.1.3 - ~/.nvm/versions/node/v14.19.2/bin/npm
    npmPackages:
      @tarojs/cli: 3.5.8 => 3.5.8
      @tarojs/components: 3.5.8 => 3.5.8
      @tarojs/helper: 3.5.8 => 3.5.8
      @tarojs/plugin-framework-react: 3.5.8 => 3.5.8
      @tarojs/plugin-platform-alipay: 3.5.8 => 3.5.8
      @tarojs/plugin-platform-jd: 3.5.8 => 3.5.8
      @tarojs/plugin-platform-qq: 3.5.8 => 3.5.8
      @tarojs/plugin-platform-swan: 3.5.8 => 3.5.8
      @tarojs/plugin-platform-tt: 3.5.8 => 3.5.8
      @tarojs/plugin-platform-weapp: 3.5.8 => 3.5.8
      @tarojs/react: 3.5.8 => 3.5.8
      @tarojs/router: 3.5.8 => 3.5.8
      @tarojs/runtime: 3.5.8 => 3.5.8
      @tarojs/shared: 3.5.8 => 3.5.8
      @tarojs/taro: 3.5.8 => 3.5.8
      @tarojs/taro-h5: 3.5.8 => 3.5.8
      @tarojs/webpack5-runner: 3.5.8 => 3.5.8
      babel-preset-taro: 3.5.8 => 3.5.8
      eslint-config-taro: 3.5.8 => 3.5.8
      react: ^18.0.0 => 18.2.0

补充信息

使用 3.5.8 就会出问题,降级到 webpack4 也会出问题

llmtgqce

llmtgqce1#

input 也无法识别

svmlkihl

svmlkihl3#

原因是 lark 插件里,运行时没有区分是否是 pc 环境,统一使用了 pc 的组件,导致和编译时的组件名不一致。

bhmjp9jg

bhmjp9jg4#

@tarojs/plugin-platform-lark@1.1.0 可以解决未定义模版的问题。

相关问题