mirror of
https://gitee.com/ant-design-vue/ant-design-vue.git
synced 2024-12-01 11:38:36 +08:00
46 lines
974 B
Vue
46 lines
974 B
Vue
import LeftOutlined from '@ant-design/icons-vue/LeftOutlined';
|
|
import RightOutlined from '@ant-design/icons-vue/RightOutlined';
|
|
import Button from '../button';
|
|
|
|
function noop() {}
|
|
|
|
const Operation = (_, { attrs }) => {
|
|
const {
|
|
disabled,
|
|
moveToLeft = noop,
|
|
moveToRight = noop,
|
|
leftArrowText = '',
|
|
rightArrowText = '',
|
|
leftActive,
|
|
rightActive,
|
|
class: className,
|
|
style,
|
|
} = attrs;
|
|
|
|
return (
|
|
<div class={className} style={style}>
|
|
<Button
|
|
type="primary"
|
|
size="small"
|
|
disabled={disabled || !rightActive}
|
|
onClick={moveToRight}
|
|
icon={<RightOutlined />}
|
|
>
|
|
{rightArrowText}
|
|
</Button>
|
|
<Button
|
|
type="primary"
|
|
size="small"
|
|
disabled={disabled || !leftActive}
|
|
onClick={moveToLeft}
|
|
icon={<LeftOutlined />}
|
|
>
|
|
{leftArrowText}
|
|
</Button>
|
|
</div>
|
|
);
|
|
};
|
|
Operation.inheritAttrs = false;
|
|
|
|
export default Operation;
|