<!-- * @Description: 搜索结果项组件 * @Author: 王晓颖 * @Date: 2022-05-18 --> <template> <div :key="data[props.label]" class="search-card" @click="clickItem()"> <div class="card-left"> {{ index+1 }} </div> <div class="card-right"> <div class="card-title"> {{ data[props.name] }} </div> <div class="card-content"> <span class="card-detail">{{ data[props.detail] }}</span> </div> </div> </div> </template> <script> export default { name: 'SearchItem', props: { data: { type: Object, required: true }, index: { type: Number | String, required: true }, props: { type: Object, default: () => { return { label: 'wellCode', name: 'wellName', detail: 'position' } } } }, data() { return { } }, methods: { clickItem() { this.$emit('click', this.data) } } } </script> <style rel="stylesheet/scss" lang="scss" scoped> .search-card{ padding:5px 10px; overflow: auto; .card-left,.card-right{ float:left } .card-left{ width:10%; line-height:25px; } .card-right{ width:90%; } .card-title{ font-size:16px; font-weight: bold; line-height: 25px; } .card-detail{ line-height:25px; } } </style>