<template>
    <div class="common-list">
        <ul>
            <li v-for="i in data" :key="i.id" @click="listCk(i)">
                <!-- <div class="left-box">
                    <van-icon name="location-o" />
                </div> -->
                <div class="center-content" style="line-height:24px">
                    <div v-for="j in config" :key="j.prop"><span>{{ j.label }}：</span>{{ i[j.prop] }}</div>
                </div>
                <div class="more-box">
                    <van-icon name="arrow" />
                </div>
            </li>
        </ul>
    </div>
</template>
<script setup>
import { ref, getCurrentInstance, onMounted,defineProps } from 'vue'
const proxy = getCurrentInstance().proxy
defineProps({
    data: {
        type: Array,
        default: []
    },
    config: {
        type: Object,
        default: []
    }
})

const listCk = (item) => {
    proxy.$emit('onClick', item)
}
</script>
<style lang="scss">
.common-list{
    ul{
        margin-top: 10px;
        li{
            list-style: none;
            position: relative;
            display: flex;
            box-sizing: border-box;
            align-items: center;
            justify-content: space-between;
            padding: 12px 16px;
            background: #fff;
            border-bottom: 1px solid #f1f1f1;
            .center-content{
                flex: 1;
            }
            .left-box{

            }
        }
    }
}
</style>