<template>
    <custom-navbar title="应用中心">
        <template #left>
            <uni-icons type="left" size="16"></uni-icons>
        </template>
        <template #right>
            <custom-button type="primary" size="small">保存</custom-button>
        </template>
    </custom-navbar>
    <view class="content">
        <view class="card">
            <view class="card-title">
                <view class="card-title-txt">首页应用</view>
                <custom-button type="primary" size="small" class="card-title-button">编辑</custom-button>
            </view>
            <view class="menu-list">
                <menu-item class="menu-item" v-for="item in menuList" :data="item" :key="item.id"></menu-item>
            </view>
        </view>
        <view class="card">
            <view class="card-title">
                <view class="card-title-txt">全部应用</view>
            </view>
            <view class="menu-list">
                <menu-item class="menu-item" v-for="item in menuList" :data="item" :key="item.id"></menu-item>
            </view>
        </view>
    </view>
</template>

<script setup>
import MenuItem from '../components/menu-item.vue'
import { menuList } from '../constants/data.config'
</script>
<style lang="scss" scoped>
.content {
    padding: 16rpx;
    .card {
        border-radius: 12rpx;
        background: #fff;
        padding: 32rpx 0 0 0;
        margin-bottom: 16rpx;
        .card-title {
            display: flex;
            justify-content: space-between;
            padding: 0 16rpx;
            margin-bottom: 14rpx;
            .card-title-txt {
                font-size: 34rpx;
                color: #1d2129;
            }
            .card-title-button {
                border-radius: 52rpx;
            }
        }
        .menu-list {
            display: flex;
            flex-wrap: wrap;
            .menu-item {
                width: 25%;
                margin: 14rpx 0;
                box-sizing: border-box;
            }
        }
    }
}
</style>
