服务内容配置

This commit is contained in:
仲么了
2023-09-22 16:33:10 +08:00
parent 525e7e6f04
commit c727be80c0
7 changed files with 198 additions and 33 deletions

View File

@@ -1,4 +1,3 @@
<template>
<view class="grid-nav">
<view class="grid-nav-title" v-if="title">{{ title }}</view>
@@ -6,30 +5,41 @@
<slot />
<Cn-grid-item background="#fff" v-for="item in seat" :key="item"></Cn-grid-item>
</view>
</view>
</view>
</template>
<script>
export default {
props: ["title"],
data () {
return {
seat: [] // 占位
};
props: {
title: {
type: String,
default: '',
},
autoFill: {
type: Boolean,
default: true,
},
},
mounted () {
console.warn(this.$slots.default.length);
let num = this.$slots.default.length;
let yushu = num % 4;
if (yushu > 0) {
for (let i = 0; i < 4 - yushu; i++) {
this.seat.push(i);
data() {
return {
seat: [], // 占位
}
},
mounted() {
if (this.autoFill) {
console.warn(this.$slots.default.length)
let num = this.$slots.default.length
let yushu = num % 4
if (yushu > 0) {
for (let i = 0; i < 4 - yushu; i++) {
this.seat.push(i)
}
}
}
},
components: {}
};
components: {},
}
</script>
<style lang='scss'>
<style lang="scss">
.grid-nav {
border-radius: 12rpx;
overflow: hidden;
@@ -51,4 +61,4 @@ export default {
grid-gap: 2rpx;
}
}
</style>
</style>