index.vue 618 B

123456789101112131415161718192021222324252627282930313233343536
  1. <template>
  2. <view class="add-cart" @click.stop="handleAddCart">
  3. <text class="icon iconfont" :class="[`icon-jiagou${btnStyle}`]"></text>
  4. </view>
  5. </template>
  6. <script>
  7. export default {
  8. props: {
  9. // 购物车按钮样式 1 2 3
  10. btnStyle: {
  11. type: Number,
  12. default: 1
  13. },
  14. },
  15. data() {
  16. return {
  17. value: false,
  18. goodsInfo: {}
  19. }
  20. },
  21. methods: {
  22. handleAddCart() {
  23. this.$emit('click')
  24. }
  25. }
  26. }
  27. </script>
  28. <style lang="scss" scoped>
  29. .add-cart {
  30. font-size: 38rpx;
  31. padding: 0 20rpx;
  32. color: #fa2209;
  33. }
  34. </style>