index.vue 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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" class="van-goods-action-icon__icon" custom-class="icon-class"></van-icon>
  4. <slot v-else name="icon"></slot>
  5. <text class="text-class">{{ text }}</text>
  6. </van-button></uni-shadow-root>
  7. </template>
  8. <script>
  9. import VanIcon from '../icon/index.vue'
  10. import VanButton from '../button/index.vue'
  11. global['__wxVueOptions'] = {components:{'van-icon': VanIcon,'van-button': VanButton}}
  12. global['__wxRoute'] = 'vant/goods-action-icon/index'
  13. import { VantComponent } from '../common/component';
  14. import { button } from '../mixins/button';
  15. import { link } from '../mixins/link';
  16. VantComponent({
  17. classes: ['icon-class', 'text-class'],
  18. mixins: [link, button],
  19. props: {
  20. text: String,
  21. dot: Boolean,
  22. info: String,
  23. icon: String,
  24. disabled: Boolean,
  25. loading: Boolean,
  26. },
  27. methods: {
  28. onClick(event) {
  29. this.$emit('click', event.detail);
  30. this.jumpLink();
  31. },
  32. },
  33. });
  34. export default global['__wxComponents']['vant/goods-action-icon/index']
  35. </script>
  36. <style platform="mp-weixin">
  37. @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}
  38. </style>