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

[Feature Request]: Steps 组件是否可以支持自定义渲染 #669

Closed
7 tasks done
hoishing-lam opened this issue Aug 1, 2024 · 1 comment
Closed
7 tasks done

Comments

@hoishing-lam
Copy link
Contributor

hoishing-lam commented Aug 1, 2024

这个 Issue 涉及以下平台:

  • 微信小程序
  • 支付宝小程序
  • 百度小程序
  • 头条小程序
  • 快手小程序
  • QQ 轻应用
  • Web 平台(H5)

您提出的功能是否和您遇到的问题有关,请描述该问题

当前我使用的 @antmjs/vantui 版本是 3.4.6, Steps 组件仅支持 steps props 传入,渲染简单的 title 与 desc 字段。希望可以支持自定义渲染,可能的使用方法如下:

import { Steps, Step } from '@antmjs/vantui'

const mySteps = (
  <Steps>
     <Step>
        {/* 这里可以自定义渲染 */}
     </Step>
  </Steps>
)

或者:

import { Steps } from '@antmjs/vantui'

const steps = [
  {
    text: '步骤一',
    desc: '描述信息',
    inactiveIcon: 'location-o',
    activeIcon: 'success',
  },
  {
    text: '步骤二',
    desc: '描述信息',
    inactiveIcon: 'like-o',
    activeIcon: 'plus',
  }
]

// 自定义渲染
const customRender = step => {
  return (
    <View>{step.title}</View>
  )
}

const mySteps = (
  <Steps steps={steps} render={customRender} />
)

参考 issue: youzan/vant-weapp#5368

您是否有建议的实现方案

其它帮助我们理解您需求的描述、截图

可以参考 https://vant-ui.github.io/vant/#/zh-CN/steps

image

@hoishing-lam
Copy link
Contributor Author

已于 #670 处理此问题

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