2018-10-11 00:21:03 +05:30
|
|
|
<template>
|
2019-12-03 15:53:54 +05:30
|
|
|
<div class="inline-grid border-b" :style="style">
|
2018-10-11 00:21:03 +05:30
|
|
|
<slot></slot>
|
|
|
|
</div>
|
|
|
|
</template>
|
2019-10-04 23:30:51 +05:30
|
|
|
<script>
|
|
|
|
export default {
|
2019-10-13 17:33:01 +05:30
|
|
|
name: 'Row',
|
2019-10-04 23:30:51 +05:30
|
|
|
props: {
|
2019-11-08 16:19:06 +05:30
|
|
|
columnWidth: {
|
|
|
|
type: String,
|
|
|
|
default: '1fr'
|
|
|
|
},
|
2019-10-04 23:30:51 +05:30
|
|
|
columnCount: {
|
|
|
|
type: Number,
|
2019-10-11 15:25:50 +05:30
|
|
|
default: 0
|
|
|
|
},
|
|
|
|
ratio: {
|
|
|
|
type: Array,
|
|
|
|
default: () => []
|
2019-10-14 03:26:20 +05:30
|
|
|
},
|
|
|
|
gap: String
|
2019-10-04 23:30:51 +05:30
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
style() {
|
2019-10-14 03:26:20 +05:30
|
|
|
let obj = {};
|
2019-10-11 15:25:50 +05:30
|
|
|
if (this.columnCount) {
|
2019-11-08 16:19:06 +05:30
|
|
|
obj['grid-template-columns'] = `repeat(${this.columnCount}, ${this.columnWidth})`;
|
2019-10-11 15:25:50 +05:30
|
|
|
}
|
|
|
|
if (this.ratio.length) {
|
2019-10-14 03:26:20 +05:30
|
|
|
obj['grid-template-columns'] = this.ratio.map(r => `${r}fr`).join(' ');
|
|
|
|
}
|
|
|
|
if (this.gap) {
|
|
|
|
obj['grid-gap'] = this.gap;
|
2019-10-04 23:30:51 +05:30
|
|
|
}
|
2019-10-14 03:26:20 +05:30
|
|
|
|
|
|
|
return obj;
|
2019-10-04 23:30:51 +05:30
|
|
|
}
|
2018-10-11 00:21:03 +05:30
|
|
|
}
|
2019-10-14 03:26:20 +05:30
|
|
|
};
|
2019-10-04 23:30:51 +05:30
|
|
|
</script>
|