Skip to content

Commit

Permalink
feat: 增加 Select 组件 arrow 动画
Browse files Browse the repository at this point in the history
  • Loading branch information
lijinke666 committed Oct 13, 2018
1 parent bed843d commit 2801585
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
6 changes: 5 additions & 1 deletion components/select/Select.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@ export default class Select extends PureComponent {

return (
<div className={cls(`${prefixCls}`, className)} {...attr}>
<div className={cls(`${prefixCls}-inner`)}>
<div
className={cls(`${prefixCls}-inner`, {
[`${prefixCls}-active`]: visible
})}
>
<Input
disabled={disabled}
readonly
Expand Down
6 changes: 6 additions & 0 deletions components/select/styles.less
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
cursor: pointer;
}
}
&-active {
.@{prefixCls}-arrow {
transform: translateY(-50%) rotate(180deg);
}
}
&-open {
animation: cuke-picker-open @default-transition forwards;
}
Expand All @@ -29,6 +34,7 @@
top: 50%;
transform: translateY(-50%);
color: @disabled-font-color;
transition: @default-transition;
}
&-content {
width: 100%;
Expand Down
2 changes: 1 addition & 1 deletion stories/dataEntry.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ storiesOf("数据录入", module)
))
)
.add(
"Select 开关",
"Select 选择器",
withInfo()(() => (
<div>
<h2>基本使用</h2>
Expand Down
8 changes: 4 additions & 4 deletions stories/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from "react";
import { storiesOf } from "@storybook/react";
import { name, repository } from "../package.json";
import Alert from "../components/alert";
import Button from "../components/button";
import Tag from "../components/tag";
import { FaGithub } from "react-icons/fa";

storiesOf("快速上手", module).add("在项目中使用", () => (
Expand Down Expand Up @@ -145,10 +145,10 @@ storiesOf("快速上手", module).add("在项目中使用", () => (
<p>← 左边是组件的列表,你可以点击预览效果</p>
<p>
点击右上角 ↗ 的{" "}
<Button type="info" size="small">
<Tag type="info">
Show Info
</Button>{" "}
按钮可以看到 示例源码 和 参数列表
</Tag>{" "}
按钮可以看到 <Tag>示例源码</Tag><Tag>参数列表</Tag>
</p>
</div>
}
Expand Down

0 comments on commit 2801585

Please sign in to comment.