index.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <template>
  2. <uni-shadow-root class="vant-goods-action-icon-index"><van-button square :id="id" size="large" :lang="lang" :loading="loading" :disabled="disabled" :open-type="openType" :business-id="businessId" custom-class="van-goods-action-icon" :session-from="sessionFrom" :app-parameter="appParameter" :send-message-img="sendMessageImg" :send-message-path="sendMessagePath" :show-message-card="showMessageCard" :send-message-title="sendMessageTitle" @click="onClick" @error="onError" @contact="onContact" @opensetting="onOpenSetting" @getuserinfo="onGetUserInfo" @getphonenumber="onGetPhoneNumber" @launchapp="onLaunchApp">
  3. <van-icon v-if="icon" :name="icon" :dot="dot" :info="info" :size="size" :color="color" :class-prefix="classPrefix" class="van-goods-action-icon__icon" custom-class="icon-class" info-class="info-class"></van-icon>
  4. <view v-else>
  5. <slot name="icon"></slot>
  6. </view>
  7. <text class="text-class">{{ text }}</text>
  8. </van-button></uni-shadow-root>
  9. </template>
  10. <script>
  11. import VanIcon from '../icon/index.vue'
  12. import VanButton from '../button/index.vue'
  13. global['__wxVueOptions'] = {components:{'van-icon': VanIcon,'van-button': VanButton}}
  14. global['__wxRoute'] = 'vant/goods-action-icon/index'
  15. import { VantComponent } from '../common/component';
  16. import { button } from '../mixins/button';
  17. import { link } from '../mixins/link';
  18. VantComponent({
  19. classes: ['icon-class', 'text-class', 'info-class'],
  20. mixins: [link, button],
  21. props: {
  22. text: String,
  23. dot: Boolean,
  24. info: String,
  25. icon: String,
  26. size: String,
  27. color: String,
  28. classPrefix: {
  29. type: String,
  30. value: 'van-icon',
  31. },
  32. disabled: Boolean,
  33. loading: Boolean,
  34. },
  35. methods: {
  36. onClick(event) {
  37. this.$emit('click', event.detail);
  38. this.jumpLink();
  39. },
  40. },
  41. });
  42. export default global['__wxComponents']['vant/goods-action-icon/index']
  43. </script>
  44. <style platform="mp-weixin">
  45. @import '../common/index.css';.van-goods-action-icon{border:none!important;color:var(--goods-action-icon-text-color,#646566)!important;display:flex!important;flex-direction:column;font-size:var(--goods-action-icon-font-size,10px)!important;height:var(--goods-action-icon-height,50px)!important;justify-content:center!important;line-height:1!important;min-width:var(--goods-action-icon-width,48px)}.van-goods-action-icon__icon{color:var(--goods-action-icon-color,#323233);display:flex;font-size:var(--goods-action-icon-size,18px);margin:0 auto 5px}
  46. </style>