From b838be1d3ee125bba58c2c213c73de806e305519 Mon Sep 17 00:00:00 2001 From: wangxueliang Date: Tue, 7 Nov 2017 14:16:17 +0800 Subject: [PATCH 1/3] pagination showTotal --- components/pagination/demo/pagination.vue | 7 +++++-- components/pagination/pagination.vue | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/components/pagination/demo/pagination.vue b/components/pagination/demo/pagination.vue index 882548b64..2787d175d 100644 --- a/components/pagination/demo/pagination.vue +++ b/components/pagination/demo/pagination.vue @@ -8,7 +8,7 @@ 改值
- + 改值 当前值
@@ -22,7 +22,7 @@ export default { return { simple: true, current: 1, - total: 500, + total: 483, } }, methods: { @@ -32,6 +32,9 @@ export default { getValue () { alert(this.current) }, + showTotal (total) { + return `共 ${total} 条` + }, }, components: { Pagination, diff --git a/components/pagination/pagination.vue b/components/pagination/pagination.vue index fe2ea60a5..361bab746 100644 --- a/components/pagination/pagination.vue +++ b/components/pagination/pagination.vue @@ -52,6 +52,7 @@ export default { type: Boolean, default: true, }, + showTotal: Function, }, model: { prop: 'current', From 748c8dc78217faba679d46e3e4eb24c22e1d97d1 Mon Sep 17 00:00:00 2001 From: wanlei Date: Tue, 7 Nov 2017 14:41:41 +0800 Subject: [PATCH 2/3] update: [grid] full demo supported :octocat: --- components/checkbox/demo/layout.vue | 18 ++-- components/grid/{col.vue => Col.vue} | 14 ++- components/grid/{row.vue => Row.vue} | 7 +- components/grid/demo/align.vue | 62 +++++++++++++ components/grid/demo/basic.vue | 48 ++++++++++ components/grid/demo/complex.vue | 34 ++++++++ components/grid/demo/flex-order.vue | 35 ++++++++ components/grid/demo/flex.vue | 68 +++++++++++++++ components/grid/demo/flexible.vue | 34 ++++++++ components/grid/demo/gutter.vue | 35 ++++++++ components/grid/demo/index.vue | 75 ++++++++++++++++ components/grid/demo/layout.vue | 44 ++++++++++ components/grid/demo/offset.vue | 40 +++++++++ components/grid/demo/pull.vue | 33 +++++++ components/grid/index.js | 5 +- components/index.js | 4 +- components/switch/Switch.vue | 87 ++++++++++++++++++ components/switch/index.js | 2 + components/switch/style/index.js | 2 + components/switch/style/index.less | 126 +++++++++++++++++++++++++++ examples/grid.vue | 98 --------------------- 21 files changed, 750 insertions(+), 121 deletions(-) rename components/grid/{col.vue => Col.vue} (89%) rename components/grid/{row.vue => Row.vue} (95%) create mode 100644 components/grid/demo/align.vue create mode 100644 components/grid/demo/basic.vue create mode 100644 components/grid/demo/complex.vue create mode 100644 components/grid/demo/flex-order.vue create mode 100644 components/grid/demo/flex.vue create mode 100644 components/grid/demo/flexible.vue create mode 100644 components/grid/demo/gutter.vue create mode 100644 components/grid/demo/index.vue create mode 100644 components/grid/demo/layout.vue create mode 100644 components/grid/demo/offset.vue create mode 100644 components/grid/demo/pull.vue create mode 100644 components/switch/Switch.vue create mode 100644 components/switch/index.js create mode 100644 components/switch/style/index.js create mode 100644 components/switch/style/index.less delete mode 100644 examples/grid.vue diff --git a/components/checkbox/demo/layout.vue b/components/checkbox/demo/layout.vue index c4e4708d0..9da57ce8e 100644 --- a/components/checkbox/demo/layout.vue +++ b/components/checkbox/demo/layout.vue @@ -1,12 +1,12 @@ + diff --git a/components/grid/demo/basic.vue b/components/grid/demo/basic.vue new file mode 100644 index 000000000..dd6b80617 --- /dev/null +++ b/components/grid/demo/basic.vue @@ -0,0 +1,48 @@ + + + diff --git a/components/grid/demo/complex.vue b/components/grid/demo/complex.vue new file mode 100644 index 000000000..490bbb4c7 --- /dev/null +++ b/components/grid/demo/complex.vue @@ -0,0 +1,34 @@ + + + diff --git a/components/grid/demo/flex-order.vue b/components/grid/demo/flex-order.vue new file mode 100644 index 000000000..2f680b396 --- /dev/null +++ b/components/grid/demo/flex-order.vue @@ -0,0 +1,35 @@ + + + diff --git a/components/grid/demo/flex.vue b/components/grid/demo/flex.vue new file mode 100644 index 000000000..d7deb1566 --- /dev/null +++ b/components/grid/demo/flex.vue @@ -0,0 +1,68 @@ + + + diff --git a/components/grid/demo/flexible.vue b/components/grid/demo/flexible.vue new file mode 100644 index 000000000..96a5c6a01 --- /dev/null +++ b/components/grid/demo/flexible.vue @@ -0,0 +1,34 @@ + + + diff --git a/components/grid/demo/gutter.vue b/components/grid/demo/gutter.vue new file mode 100644 index 000000000..b9ce3d289 --- /dev/null +++ b/components/grid/demo/gutter.vue @@ -0,0 +1,35 @@ + + + diff --git a/components/grid/demo/index.vue b/components/grid/demo/index.vue new file mode 100644 index 000000000..9d25299d3 --- /dev/null +++ b/components/grid/demo/index.vue @@ -0,0 +1,75 @@ + + + diff --git a/components/grid/demo/layout.vue b/components/grid/demo/layout.vue new file mode 100644 index 000000000..58ca44de9 --- /dev/null +++ b/components/grid/demo/layout.vue @@ -0,0 +1,44 @@ + + + diff --git a/components/grid/demo/offset.vue b/components/grid/demo/offset.vue new file mode 100644 index 000000000..293141411 --- /dev/null +++ b/components/grid/demo/offset.vue @@ -0,0 +1,40 @@ + + + diff --git a/components/grid/demo/pull.vue b/components/grid/demo/pull.vue new file mode 100644 index 000000000..1b249d074 --- /dev/null +++ b/components/grid/demo/pull.vue @@ -0,0 +1,33 @@ + + + diff --git a/components/grid/index.js b/components/grid/index.js index 352a384d8..cd65231b0 100644 --- a/components/grid/index.js +++ b/components/grid/index.js @@ -1,7 +1,6 @@ -import Row from './row.vue' -import Col from './col.vue' +import Row from './Row.vue' +import Col from './Col.vue' export default { Col, Row, } - diff --git a/components/index.js b/components/index.js index ca29ac8f5..be9cf66de 100644 --- a/components/index.js +++ b/components/index.js @@ -12,6 +12,6 @@ export { default as Rate } from './rate' export { default as ToolTip } from './tooltip' -export { default as Row } from './grid/row' +export { default as Row } from './grid/Row' -export { default as Col } from './grid/col' +export { default as Col } from './grid/Col' diff --git a/components/switch/Switch.vue b/components/switch/Switch.vue new file mode 100644 index 000000000..3f3a22ab5 --- /dev/null +++ b/components/switch/Switch.vue @@ -0,0 +1,87 @@ + + diff --git a/components/switch/index.js b/components/switch/index.js new file mode 100644 index 000000000..54acb541f --- /dev/null +++ b/components/switch/index.js @@ -0,0 +1,2 @@ +import Switch from './Switch.vue' +export default Switch diff --git a/components/switch/style/index.js b/components/switch/style/index.js new file mode 100644 index 000000000..cf31ed80f --- /dev/null +++ b/components/switch/style/index.js @@ -0,0 +1,2 @@ +import '../../style/index.less' +import './index.less' diff --git a/components/switch/style/index.less b/components/switch/style/index.less new file mode 100644 index 000000000..8d3bcc552 --- /dev/null +++ b/components/switch/style/index.less @@ -0,0 +1,126 @@ +@import "../../style/themes/default"; +@import "../../style/mixins/index"; + +@switch-prefix-cls: ~"@{ant-prefix}-switch"; +@switch-duration: .36s; + +.@{switch-prefix-cls} { + position: relative; + display: inline-block; + box-sizing: border-box; + height: 22px; + min-width: 44px; + line-height: 20px; + vertical-align: middle; + border-radius: 20px; + border: 1px solid transparent; + background-color: @disabled-color; + cursor: pointer; + transition: all @switch-duration; + user-select: none; + + &-inner { + color: #fff; + font-size: @font-size-base; + margin-left: 24px; + margin-right: 6px; + display: block; + } + + &:after { + position: absolute; + width: 18px; + height: 18px; + left: 1px; + top: 1px; + + border-radius: 18px; + background-color: @component-background; + content: " "; + cursor: pointer; + transition: all @switch-duration @ease-in-out-circ; + } + + &:active:after { + width: 24px; + } + + &:focus { + box-shadow: 0 0 0 2px fade(@primary-color, 20%); + outline: 0; + } + + &:focus:hover { + box-shadow: none; + } + + &-small { + height: 14px; + min-width: 28px; + line-height: 12px; + + .@{switch-prefix-cls}-inner { + margin-left: 18px; + margin-right: 3px; + } + + &:after { + width: 12px; + height: 12px; + top: 0; + left: 0.5px; + } + + &:active:after { + width: 16px; + } + } + + &-small&-checked { + &:after { + left: 100%; + margin-left: -12.5px; + } + + .@{switch-prefix-cls}-inner { + margin-left: 3px; + margin-right: 18px; + } + } + + &-small:active&-checked:after { + margin-left: -16.5px; + } + + &-checked { + background-color: @primary-color; + + .@{switch-prefix-cls}-inner { + margin-left: 6px; + margin-right: 24px; + } + + &:after { + left: 100%; + margin-left: -19px; + } + + &:active:after { + margin-left: -25px; + } + } + + &-disabled { + cursor: not-allowed; + background: #f4f4f4; + + &:after { + background: #ccc; + cursor: not-allowed; + } + + .@{switch-prefix-cls}-inner { + color: @disabled-color; + } + } +} diff --git a/examples/grid.vue b/examples/grid.vue deleted file mode 100644 index a721853b9..000000000 --- a/examples/grid.vue +++ /dev/null @@ -1,98 +0,0 @@ - - - From a7398d4842d4b449512ef2d393e9e5c618ffd5c3 Mon Sep 17 00:00:00 2001 From: wanlei Date: Thu, 9 Nov 2017 10:19:38 +0800 Subject: [PATCH 3/3] fix: [switch] removed --- components/switch/Switch.vue | 87 -------------------- components/switch/index.js | 2 - components/switch/style/index.js | 2 - components/switch/style/index.less | 126 ----------------------------- 4 files changed, 217 deletions(-) delete mode 100644 components/switch/Switch.vue delete mode 100644 components/switch/index.js delete mode 100644 components/switch/style/index.js delete mode 100644 components/switch/style/index.less diff --git a/components/switch/Switch.vue b/components/switch/Switch.vue deleted file mode 100644 index 3f3a22ab5..000000000 --- a/components/switch/Switch.vue +++ /dev/null @@ -1,87 +0,0 @@ - - diff --git a/components/switch/index.js b/components/switch/index.js deleted file mode 100644 index 54acb541f..000000000 --- a/components/switch/index.js +++ /dev/null @@ -1,2 +0,0 @@ -import Switch from './Switch.vue' -export default Switch diff --git a/components/switch/style/index.js b/components/switch/style/index.js deleted file mode 100644 index cf31ed80f..000000000 --- a/components/switch/style/index.js +++ /dev/null @@ -1,2 +0,0 @@ -import '../../style/index.less' -import './index.less' diff --git a/components/switch/style/index.less b/components/switch/style/index.less deleted file mode 100644 index 8d3bcc552..000000000 --- a/components/switch/style/index.less +++ /dev/null @@ -1,126 +0,0 @@ -@import "../../style/themes/default"; -@import "../../style/mixins/index"; - -@switch-prefix-cls: ~"@{ant-prefix}-switch"; -@switch-duration: .36s; - -.@{switch-prefix-cls} { - position: relative; - display: inline-block; - box-sizing: border-box; - height: 22px; - min-width: 44px; - line-height: 20px; - vertical-align: middle; - border-radius: 20px; - border: 1px solid transparent; - background-color: @disabled-color; - cursor: pointer; - transition: all @switch-duration; - user-select: none; - - &-inner { - color: #fff; - font-size: @font-size-base; - margin-left: 24px; - margin-right: 6px; - display: block; - } - - &:after { - position: absolute; - width: 18px; - height: 18px; - left: 1px; - top: 1px; - - border-radius: 18px; - background-color: @component-background; - content: " "; - cursor: pointer; - transition: all @switch-duration @ease-in-out-circ; - } - - &:active:after { - width: 24px; - } - - &:focus { - box-shadow: 0 0 0 2px fade(@primary-color, 20%); - outline: 0; - } - - &:focus:hover { - box-shadow: none; - } - - &-small { - height: 14px; - min-width: 28px; - line-height: 12px; - - .@{switch-prefix-cls}-inner { - margin-left: 18px; - margin-right: 3px; - } - - &:after { - width: 12px; - height: 12px; - top: 0; - left: 0.5px; - } - - &:active:after { - width: 16px; - } - } - - &-small&-checked { - &:after { - left: 100%; - margin-left: -12.5px; - } - - .@{switch-prefix-cls}-inner { - margin-left: 3px; - margin-right: 18px; - } - } - - &-small:active&-checked:after { - margin-left: -16.5px; - } - - &-checked { - background-color: @primary-color; - - .@{switch-prefix-cls}-inner { - margin-left: 6px; - margin-right: 24px; - } - - &:after { - left: 100%; - margin-left: -19px; - } - - &:active:after { - margin-left: -25px; - } - } - - &-disabled { - cursor: not-allowed; - background: #f4f4f4; - - &:after { - background: #ccc; - cursor: not-allowed; - } - - .@{switch-prefix-cls}-inner { - color: @disabled-color; - } - } -}