This commit is contained in:
syuilo
2021-04-17 00:12:50 +09:00
parent e62d7bc1ba
commit 27c373ddf4
9 changed files with 89 additions and 67 deletions

View File

@ -18,7 +18,12 @@ export default defineComponent({
type: Boolean,
required: false,
default: false
}
},
noGap: {
type: Boolean,
required: false,
default: false
},
},
methods: {
@ -37,18 +42,16 @@ export default defineComponent({
},
render() {
const noGap = [...document.querySelectorAll('._noGap_')].some(el => el.contains(this.$parent.$el));
if (this.items.length === 0) return;
return h(this.$store.state.animation ? TransitionGroup : 'div', this.$store.state.animation ? {
class: 'sqadhkmv' + (noGap ? ' _block' : ''),
class: 'sqadhkmv' + (this.noGap ? ' noGap _block' : ''),
name: 'list',
tag: 'div',
'data-direction': this.direction,
'data-reversed': this.reversed ? 'true' : 'false',
} : {
class: 'sqadhkmv',
class: 'sqadhkmv' + (this.noGap ? ' noGap _block' : ''),
}, this.items.map((item, i) => {
const el = this.$slots.default({
item: item
@ -154,17 +157,17 @@ export default defineComponent({
}
}
}
}
._noGap_ .sqadhkmv {
> * {
margin: 0 !important;
border: none;
border-radius: 0;
box-shadow: none;
&.noGap {
> * {
margin: 0 !important;
border: none;
border-radius: 0;
box-shadow: none;
&:not(:last-child) {
border-bottom: solid 0.5px var(--divider);
&:not(:last-child) {
border-bottom: solid 0.5px var(--divider);
}
}
}
}