mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
add grid item to grid docs
This commit is contained in:
parent
f51890a54f
commit
4edb8cd541
@ -17,18 +17,30 @@
|
||||
export default {
|
||||
name: 'DsGrid',
|
||||
props: {
|
||||
/**
|
||||
* The vertical and horizontal gap between grid items
|
||||
*/
|
||||
gap: {
|
||||
type: Number,
|
||||
default: 16, // TODO: how to use tokens.small here?
|
||||
},
|
||||
/**
|
||||
* The minimum width of each column
|
||||
*/
|
||||
minColumnWidth: {
|
||||
type: Number,
|
||||
default: 250,
|
||||
},
|
||||
/**
|
||||
* The height of each row (recommended to use the default)
|
||||
*/
|
||||
rowHeight: {
|
||||
type: Number,
|
||||
default: 20,
|
||||
},
|
||||
/**
|
||||
* The outermost html tag
|
||||
*/
|
||||
tag: {
|
||||
type: String,
|
||||
default: 'div',
|
||||
|
||||
@ -8,30 +8,44 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'DsGridItem',
|
||||
props: {
|
||||
columnSpan: {
|
||||
type: [String, Number],
|
||||
default: 1,
|
||||
},
|
||||
rowSpan: {
|
||||
type: Number,
|
||||
default: 4,
|
||||
},
|
||||
tag: {
|
||||
type: String,
|
||||
default: 'div',
|
||||
},
|
||||
/**
|
||||
* @version 1.0.0
|
||||
* @see DsGrid
|
||||
*/
|
||||
export default {
|
||||
name: 'DsGridItem',
|
||||
props: {
|
||||
/**
|
||||
* The number of columns the item will span
|
||||
* @options 'fullWidth'|number
|
||||
*/
|
||||
columnSpan: {
|
||||
type: [String, Number],
|
||||
default: 1,
|
||||
},
|
||||
computed: {
|
||||
styles() {
|
||||
return {
|
||||
gridRowEnd: `span ${this.rowSpan}`,
|
||||
gridColumnStart: this.columnSpan === 'fullWidth' ? 1 : 'auto',
|
||||
gridColumnEnd: this.columnSpan === 'fullWidth' ? -1 : `span ${this.columnSpan}`,
|
||||
}
|
||||
/**
|
||||
* The number of rows the item will span
|
||||
*/
|
||||
rowSpan: {
|
||||
type: Number,
|
||||
default: 4,
|
||||
},
|
||||
/**
|
||||
* The outermost html tag
|
||||
*/
|
||||
tag: {
|
||||
type: String,
|
||||
default: 'div',
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
styles() {
|
||||
return {
|
||||
gridRowEnd: `span ${this.rowSpan}`,
|
||||
gridColumnStart: this.columnSpan === 'fullWidth' ? 1 : 'auto',
|
||||
gridColumnEnd: this.columnSpan === 'fullWidth' ? -1 : `span ${this.columnSpan}`,
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user