Skip to content

Latest commit

 

History

History
96 lines (90 loc) · 2.02 KB

Steps.mdx

File metadata and controls

96 lines (90 loc) · 2.02 KB
title
Steps 步骤条

示例

import { Steps } from '@tarojsx/ui'; import { UI } from '@/ui';

const Demo = () => {
  const [current, setCurrent] = React.useState(0);
  const onChange = React.useCallback((index) => {
    setCurrent(index);
  }, []);
  return (
    <Steps
      items={[
        { title: '选购' },
        {
          title: '确认',
          desc: '这里是额外的信息,最多两行',
          icon: {
            value: 'shopping-cart',
            activeColor: '#fff',
            inactiveColor: '#78A4FA',
            size: '14',
          },
        },
        {
          title: '支付',
          icon: {
            value: 'credit-card',
            activeColor: '#fff',
            inactiveColor: '#78A4FA',
            size: '14',
          },
        },
        {
          title: '完成',
          status: 'success',
        },
      ]}
      current={current}
      onChange={onChange}
    />
  );
};
{() => { const [current, setCurrent] = React.useState(0); const onChange = React.useCallback((index) => { setCurrent(index); }, []); return ( ); }}

API