<template>
  <div class="search-tag-message">
    <p class="tips">交小通猜你想查：</p>
    <ul class="search-tag-list">
      <template v-for="(item,index) in data">
        <li class="search-tag-item" :key="item.id" @click="$emit('change', item)">
          <span class="num">{{index+1}}:</span>
          <span class="text">{{item.title}}</span>
        </li>
      </template>
    </ul>
  </div>
</template>

<script>
export default {
  name: 'SearchTagMessage',
  props: {
    data: { type: Array }
  }
}
</script>

<style lang="scss" scoped>
.search-tag-message {
  padding: 10px;
  background-color: #fff;
  border-radius: 6px;
}
.search-tag-item {
  margin: 10px 0;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  .num {
    display: inline-block;
    min-width: 24px;
  }
  .text {
    border-bottom: 1px solid #2b7ce9;
    cursor: pointer;
  }
}
</style>
