<template>
    <view v-if="data.length" class="result-wrapper">
        <view
            v-for="(item, index) in data"
            :key="index"
            class=""
        >
            <view class="item" @tap.stop="onQueryTap(item)">
                <c-icon name="search" class="icon"/>
                <rich-text :nodes="item.name"/>
            </view>
        </view>
    </view>
</template>

<script>
/**
 * @file 头图
 * @author mazihan
 */

import CIcon from '@baidu/med-ui/components/Icon/Icon';

export default {
    config: {
        component: true
    },
    components: {
        CIcon
    },
    props: {
        /**
         * title
         */
        data: {
            type: Array,
            default: () => []
        }
    },
    data() {
        return {

        };
    },
    created() {},
    methods: {
        onQueryTap(item) {
            this.$emit('onQueryTap', item);
        }
    }
};
</script>
<style lang="less" scoped>
.result-wrapper {
    padding: .1rem .17rem 0;
    .item {
        display: flex;
        align-items: center;
        height: .53rem;
        line-height: .53rem;
        font-size: .17rem;
        color: #1f1f1f;
        .icon {
            color: #ddd;
            margin-right: .05rem;
        }
    }
}
</style>
