diff --git a/examples/routers/list.vue b/examples/routers/list.vue index d8c800fb..82ca54df 100644 --- a/examples/routers/list.vue +++ b/examples/routers/list.vue @@ -1,26 +1,75 @@ @@ -34,6 +83,33 @@ 'Australian walks 100km after outback crash.', 'Man charged over missing wedding girl.', 'Los Angeles battles huge wildfires.', + ], + data2: [ + { + title: 'This is a title 1', + description: 'This is the description, This is the description, This is the description.', + avatar: 'https://dev-file.iviewui.com/userinfoPDvn9gKWYihR24SpgC319vXY8qniCqj4/avatar' + }, + { + title: 'This is a title 2', + description: 'This is the description, This is the description, This is the description.', + avatar: 'https://dev-file.iviewui.com/userinfoPDvn9gKWYihR24SpgC319vXY8qniCqj4/avatar' + }, + { + title: 'This is a title 3', + description: 'This is the description, This is the description, This is the description.', + avatar: 'https://dev-file.iviewui.com/userinfoPDvn9gKWYihR24SpgC319vXY8qniCqj4/avatar' + }, + { + title: 'This is a title 4', + description: 'This is the description, This is the description, This is the description.', + avatar: 'https://dev-file.iviewui.com/userinfoPDvn9gKWYihR24SpgC319vXY8qniCqj4/avatar' + }, + { + title: 'This is a title 5', + description: 'This is the description, This is the description, This is the description.', + avatar: 'https://dev-file.iviewui.com/userinfoPDvn9gKWYihR24SpgC319vXY8qniCqj4/avatar' + } ] }; } diff --git a/src/components/list/list-item.vue b/src/components/list/list-item.vue index abd6f319..c48a4d56 100644 --- a/src/components/list/list-item.vue +++ b/src/components/list/list-item.vue @@ -1,13 +1,36 @@ diff --git a/src/components/list/list.vue b/src/components/list/list.vue index c931dfc4..b51cf976 100644 --- a/src/components/list/list.vue +++ b/src/components/list/list.vue @@ -4,7 +4,7 @@
- + @@ -15,6 +15,11 @@ export default { name: 'List', + provide () { + return { + ListInstance: this + }; + }, props: { border: { type: Boolean, diff --git a/src/styles/components/list.less b/src/styles/components/list.less index bd196232..8d8771b2 100644 --- a/src/styles/components/list.less +++ b/src/styles/components/list.less @@ -31,6 +31,7 @@ flex: 1 0; } &-title { + font-weight: bold; margin-bottom: 4px; color: @text-color; font-size: @font-size-base; @@ -65,18 +66,28 @@ line-height: 22px; text-align: center; cursor: pointer; + + &:after{ + content: ''; + position: absolute; + top: 50%; + right: 0; + width: 1px; + height: 14px; + margin-top: -7px; + background-color: @border-color-split; + } } & > li:first-child { padding-left: 0; } + & > li:last-child { + &:after{ + display: none; + } + } &-split { - position: absolute; - top: 50%; - right: 0; - width: 1px; - height: 14px; - margin-top: -7px; - background-color: @border-color-split; + } } } @@ -154,6 +165,20 @@ } } } + + // without flex + &-item-no-flex { + display: block; + } + + // Horizontal + &:not(.@{list-prefix-cls}-vertical) { + .@{list-prefix-cls}-item-no-flex { + .@{list-prefix-cls}-item-action { + float: right; + } + } + } } .@{list-prefix-cls}-bordered {