Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions docs/.vuepress/components/Demos/Card/FixedHeight.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<template>
<vs-row vs-justify="center">
<vs-col vs-type="flex" vs-justify="center" vs-align="center" vs-w="6">
<vs-card class="cardx" fixed-height>
<div slot="header">
<h3>
Hello world !
</h3>
</div>
<div slot="media">
<img :src="$withBase('/card.png')">
</div>
<div>
<span>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</span>
<span>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</span>
</div>
<div slot="footer">
<vs-row vs-justify="flex-end">
<vs-button vs-type="gradient" color="danger" vs-icon="favorite"></vs-button>
<vs-button color="primary" vs-icon="turned_in_not"></vs-button>
<vs-button color="rgb(230,230,230)" color-text="rgb(50,50,50)" vs-icon="settings"></vs-button>
</vs-row>
</div>
</vs-card>
</vs-col>
<vs-col vs-type="flex" vs-justify="center" vs-align="center" vs-w="6">
<vs-card class="cardx" fixed-height>
<div slot="header">
<h3>
Hello world !
</h3>
</div>
<div slot="media">
<img :src="$withBase('/card2.png')">
</div>
<div>
<span>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</span>
</div>
<div slot="footer">
<vs-row vs-justify="flex-end">
<vs-button vs-type="gradient" color="danger" vs-icon="favorite"></vs-button>
<vs-button color="primary" vs-icon="turned_in_not"></vs-button>
<vs-button color="rgb(230,230,230)" color-text="rgb(50,50,50)" vs-icon="settings"></vs-button>
</vs-row>
</div>
</vs-card>
</vs-col>
</vs-row>
</template>
<script>
export default {

}
</script>
<style lang="stylus">
.cardx
margin 15px
</style>
83 changes: 83 additions & 0 deletions docs/components/card.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ API:
parameters:
description: slot extra contend and card
default: null
- name: fixed-height
type: Boolean
parameters:
description: Set the card with 100% of height
default: false
- name: actionable
type: Boolean
parameters:
Expand Down Expand Up @@ -176,6 +181,84 @@ export default {

<box>

## Fixed Height

If you need to set card with the same height, send the prop `fixed-height` and cards set to 100% of height.

<vuecode md>
<div slot="demo">
<Demos-Card-FixedHeight />
</div>
<div slot="code">

```html
<template>
<vs-row vs-justify="center">
<vs-col vs-type="flex" vs-justify="center" vs-align="center" vs-w="6">
<vs-card class="cardx" fixedHeight>
<div slot="header">
<h3>
Hello world !
</h3>
</div>
<div slot="media">
<img :src="$withBase('/card.png')">
</div>
<div>
<span>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</span>
<span>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</span>
</div>
<div slot="footer">
<vs-row vs-justify="flex-end">
<vs-button vs-type="gradient" color="danger" vs-icon="favorite"></vs-button>
<vs-button color="primary" vs-icon="turned_in_not"></vs-button>
<vs-button color="rgb(230,230,230)" color-text="rgb(50,50,50)" vs-icon="settings"></vs-button>
</vs-row>
</div>
</vs-card>
</vs-col>
<vs-col vs-type="flex" vs-justify="center" vs-align="center" vs-w="6">
<vs-card class="cardx" fixedHeight>
<div slot="header">
<h3>
Hello world !
</h3>
</div>
<div slot="media">
<img :src="$withBase('/card2.png')">
</div>
<div>
<span>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</span>
</div>
<div slot="footer">
<vs-row vs-justify="flex-end">
<vs-button vs-type="gradient" color="danger" vs-icon="favorite"></vs-button>
<vs-button color="primary" vs-icon="turned_in_not"></vs-button>
<vs-button color="rgb(230,230,230)" color-text="rgb(50,50,50)" vs-icon="settings"></vs-button>
</vs-row>
</div>
</vs-card>
</vs-col>
</vs-row>
</template>
<script>
export default {

}
</script>
<style lang="stylus">
.cardx
margin 15px
</style>

```

</div>
</vuecode>
</box>

<box>

## Hover

You can add hover functionality with the property `actionable`
Expand Down
9 changes: 9 additions & 0 deletions src/components/vsCard/main.styl
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
box-shadow: 0px 0px 5px 0px rgba(0,0,0,.1) !important
img
transform: scale(1.1)
&.fixedHeight
height: 100%
position: relative
.vs-card-header
padding: 10px
box-shadow: 0px 10px 15px -10px rgba(0,0,0,.05)
Expand All @@ -27,9 +30,15 @@
margin-top: -5%
padding-top: 0px
overflow hidden
&.fixedHeight
position: absolute
bottom: 0
right: 0
.vs-card-content
padding: 10px
font-size: .8rem
&.fixedHeight
margin-bottom: 20px
.vs-card-media
width: 100%
overflow hidden
Expand Down
10 changes: 8 additions & 2 deletions src/components/vsCard/vsCard.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div
:class="{'withHover': actionable }"
:class="{'withHover': actionable, 'fixedHeight': fixedHeight }"
class="con-vs-card">
<header
v-if="hasSlot('header')"
Expand All @@ -16,6 +16,7 @@

<div
v-if="hasSlot('default')"
:class="{'fixedHeight': fixedHeight }"
class="vs-card-content">
<slot></slot>
</div>
Expand All @@ -28,6 +29,7 @@

<footer
v-if="hasSlot('footer')"
:class="{'fixedHeight': fixedHeight }"
class="vs-card-footer">
<slot name="footer"></slot>
</footer>
Expand All @@ -39,7 +41,11 @@
props:{
actionable: {
default: false,
type: [Boolean, String]
type: Boolean
},
fixedHeight: {
default: false,
type: Boolean
}
},
methods: {
Expand Down