Skip to content

微信小程序 Input #1514

@laboratory9173

Description

@laboratory9173

组件

"ant-input": "antd-mini/Input/index"

基础库版本

  • 1.x
  • 2.x

设备机型

手机系统

  • iOS
  • Android
  • HarmonyOS

APP

微信小程序

组件库版本

3.4.1

预期行为

应当是正常使用 input

复现步骤

  1. 修改XX.json 引入
    "usingComponents": {
    "ant-input": "antd-mini/Input/index"
    }
  2. 编译随即报错
  3. 发现经过微信工具生成的 miniprogram_npm/antd-mini/Input/index.wxml
  <view class="ant-input-prefix">
    <slot name="prefix">{{prefix}}</slot>
  </view>

  <view class="ant-input-suffix">
    <slot name="suffix">{{suffix}}</slot>
  </view>

{{prefix}} 是非法的 WXML 语法,微信小程序不支持。

报错如下

Error: Failed to compile WXML files:

- /miniprogram_npm/antd-mini/Input/index.wxml:10:24-10:34: Error: child nodes are not allowed for this element
- /miniprogram_npm/antd-mini/Input/index.wxml:56:24-56:34: Error: child nodes are not allowed for this element
- WXS compile error at /miniprogram_npm/antd-mini/Input/index.wxml: Template error: no template "miniprogram_npm/antd-mini/Input/index" found(env: Windows,mp,1.06.2504030; lib: 3.10.0)

复现 demo

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions