<template>
  <span @click.stop="goSearch(text)" class="c-tag">{{text}}</span>
</template>


<script>
export default {
  props: ['text'],
  methods: {
    goSearch(key) {
      wx.redirectTo({
        url: `/pages/search/main?key=tag:${key}`
      })
    }
  }
}
</script>

<style lang="less" scoped>
.c-tag {
  display: inline-block;
  padding: 8rpx 16rpx;
  margin-right: 16rpx;
  margin-bottom: 16rpx;
  border-right: 16rpx;
  border-radius: 16rpx;
  color: #999;
  font-size: 24rpx;
  background-color: #fcfcef;

  &::before {
    content: '#';
    margin-right: 8rpx;
    color: #ffdc34;
  }
}
</style>