mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2026-02-06 09:55:50 +00:00
add grid item component
This commit is contained in:
parent
3a93d9abb3
commit
2ccaeb6166
@ -31,14 +31,17 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
styles() {
|
||||
return ({
|
||||
return {
|
||||
gridTemplateColumns: `repeat(auto-fill, minmax(${this.minColumnWidth}px, 1fr`,
|
||||
gridGap: `${this.gap}px`,
|
||||
gridAutoRows: `${this.rowHeight}px`,
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" src="./style.scss" />
|
||||
<style lang="scss" src="./style.scss">
|
||||
</style>
|
||||
|
||||
<docs src="./demo.md"></docs>
|
||||
|
||||
@ -1,13 +1,37 @@
|
||||
<template>
|
||||
<component :is="tag">
|
||||
<component
|
||||
:is="tag"
|
||||
:style="styles"
|
||||
>
|
||||
<slot />
|
||||
</component>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'DsGridItem',
|
||||
name: 'DsGridItem',
|
||||
props: {
|
||||
columnSpan: {
|
||||
type: [String, Number],
|
||||
default: 1,
|
||||
},
|
||||
rowSpan: {
|
||||
type: Number,
|
||||
default: 10,
|
||||
},
|
||||
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>
|
||||
|
||||
<style/>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user