taro-ui icon indicating copy to clipboard operation
taro-ui copied to clipboard

atcard组件 自定义图标功能无效

Open mathcw opened this issue 5 years ago • 10 comments

Taro UI 版本信息

v2.3.4

问题描述

使用 renderIcon 渲染自定义图标 无法显示

复现步骤

引入atcard 使用 renderIcon 即可复现

复现代码

            <AtCard
              className='card'
              title={item.date}
              renderIcon={<AtIcon value='clock' size='16' color='#F00'></AtIcon>}
            >
              这也是内容区 可以随意定义功能
            </AtCard>

报错信息

系统信息

Taro CLI 2.1.5 environment info: System: OS: macOS 10.15.4 Shell: 3.2.57 - /bin/bash Binaries: Node: 10.16.0 - /usr/local/bin/node Yarn: 1.16.0 - /usr/local/bin/yarn npm: 6.14.4 - /usr/local/bin/npm npmPackages: @tarojs/components: 2.1.5 => 2.1.5 @tarojs/components-qa: 2.1.5 => 2.1.5 @tarojs/mini-runner: 2.1.5 => 2.1.5 @tarojs/redux: 2.1.5 => 2.1.5 @tarojs/redux-h5: 2.1.5 => 2.1.5 @tarojs/router: 2.1.5 => 2.1.5 @tarojs/taro: 2.1.5 => 2.1.5 @tarojs/taro-alipay: 2.1.5 => 2.1.5 @tarojs/taro-h5: 2.1.5 => 2.1.5 @tarojs/taro-qq: 2.1.5 => 2.1.5 @tarojs/taro-quickapp: 2.1.5 => 2.1.5 @tarojs/taro-swan: 2.1.5 => 2.1.5 @tarojs/taro-tt: 2.1.5 => 2.1.5 @tarojs/taro-weapp: 2.1.5 => 2.1.5 @tarojs/webpack-runner: 2.1.5 => 2.1.5 eslint-config-taro: 2.1.5 => 2.1.5 eslint-plugin-taro: 2.1.5 => 2.1.5 nerv-devtools: ^1.5.5 => 1.5.6 nervjs: ^1.5.5 => 1.5.6 stylelint-config-taro-rn: 2.1.5 => 2.1.5 stylelint-taro-rn: 2.1.5 => 2.1.5 taro-ui: ^2.3.4 => 2.3.4

补充信息

在微信工具中进行审查 没有办法发现元素对应节点 使用官网示例代码也无法使用正常的功能

mathcw avatar May 12 '20 06:05 mathcw

欢迎提交 Issue~

如果你提交的是 bug 报告,请务必遵循 Issue 模板的规范,尽量用简洁的语言描述你的问题,最好能提供一个稳定简单的复现。🙏🙏🙏

如果你的信息提供过于模糊或不足,或者已经其他 issue 已经存在相关内容,你的 issue 有可能会被关闭。

Good luck and happy coding~

taro-ui-bot[bot] avatar May 12 '20 06:05 taro-ui-bot[bot]

用法错了,参考 https://reactjs.org/docs/render-props.html

Garfield550 avatar May 12 '20 07:05 Garfield550

bf7d066 官网示例 我并没有发现用法哪里错了呀

mathcw avatar May 12 '20 07:05 mathcw

新的历史遗留问题,这个实现有问题,晚上我研究下

Garfield550 avatar May 12 '20 08:05 Garfield550

Render Props 编译出来的 slot 似乎有点问题。

<block wx:if="{{$taroCompReady}}">
    <view class="index"><text>Hello world!</text>
        <at-card compid="{{$compid__13}}">这也是内容区 可以随意定义功能
            <view slot="icon">
                <view>
                    <template is="renderClosureIconbezzz" data="{{...anonymousState__temp}}"></template>
                </view>
            </view>
        </at-card>
    </view>
</block>
<template name="renderClosureIconbezzz">
    <block><text class="at-icon at-icon-settings"></text>
    </block>
</template>

image

Garfield550 avatar May 12 '20 15:05 Garfield550

这个问题解决了么?

我也是跟楼主这么用的,也不能复现

        <AtCard title={title} renderIcon={<AtIcon value='clock'></AtIcon>}>

CiciMa avatar May 24 '20 00:05 CiciMa

同问,解决了么?这个特性还蛮有用的

seed-fe avatar Jun 04 '20 10:06 seed-fe

+1 求解决

rookieHcy avatar Jul 29 '20 03:07 rookieHcy

解决了吗

thl3538 avatar Apr 12 '21 02:04 thl3538

+1 , 还有人解决么

bxter avatar Oct 09 '24 12:10 bxter