index.vue 1.02 KB
<!--
 * @Date: 2022-06-25 03:29:05
 * @LastEditors: hookehuyr hookehuyr@gmail.com
 * @LastEditTime: 2022-06-25 10:26:12
 * @FilePath: /tswj/src/components/FlowerIcon/index.vue
 * @Description: 文件描述
-->
<template>
  <div class="flower" @click="goTo">
    <van-icon :name="icon_flower" color="#c5c5c5" size="1.25rem" :style="{ verticalAlign: align }" />
    <span :style="{ color }">&nbsp;{{ qty }}</span>
  </div>
  <!-- <div class="global-center" style="color: #222222;" @click="goTo">
    <van-icon :name="icon_flower" color="#c5c5c5" size="1.25rem" :style="{ verticalAlign: align }" />
    <span>&nbsp;{{ qty }}</span>
  </div> -->
</template>

<script setup>
import { icon_flower } from '@/utils/generateIcons.js'

const props = defineProps({
  qty: Number,
  color: String,
  align: String,
})
const emit = defineEmits(['on-click']);
const goTo = () => {
  emit('on-click', true)
}
</script>

<style lang="less" scoped>
.flower {
  text-align: center; 
  position: absolute; 
  top: 40%; 
  right: 0.5rem;
  color: #713610;
}
</style>