van_buttom.vue 502 B

123456789101112131415161718
  1. <template>
  2. <div :style="item.style">
  3. <van-button :block="block" :type="btnType" disabled :native-type="nativeType">
  4. {{ label }}
  5. </van-button>
  6. </div>
  7. </template>
  8. <script setup>
  9. import { ref, defineProps } from 'vue';
  10. const props = defineProps({
  11. item: Object,
  12. });
  13. const item = JSON.parse(JSON.stringify(props.item || '{}'));
  14. const label = ref(item.text);
  15. const block = ref(item.attr.block);
  16. const nativeType = ref(item.attr.nativeType);
  17. const btnType = ref(item.attr.type);
  18. </script>