<template>
    <div class="list">
        <div class="item" v-for="item in data" @click="itemClick(item.path)">
            <img :src="item.img">
            <span>{{item.title}}</span>
        </div>
    </div>
</template>

<script>
    export default{
        props:{
            data:{
                type:Array,
                default(){
                    return [];
                }
            }
        },
        methods:{
            itemClick(path){
                this.$emit('click',path);
            }
        }
    }
</script>

<style scoped>
    .list{
        margin:-10px;
    }

    .item{
        font-size:0;
        padding:5px 10px;
        cursor:pointer;
    }

    .item:not(:last-child){
        border-bottom:1px solid #d6d6d6;
    }

    .item:hover{
        background-color:#fff294;
    }

    .item img{
        width:16px;
    }

    .item span{
        font-size:14px;
        vertical-align: middle;
        margin-left:5px;
    }
</style>
