ApproveButton.vue 711 B

12345678910111213141516171819202122232425
  1. <template>
  2. <view style="width:50%">
  3. <u-button type="success" text="同意" size="small" @click="handleApprove" v-bind="$attrs" />
  4. <!-- 确认弹窗 -->
  5. <u-modal :show="showConfirmModal" title="确认" content="确认收到货了吗?" @confirm="confirmApprove" showCancelButton :content-style="{textAlign:'center'}"
  6. @cancel="showConfirmModal = false" />
  7. </view>
  8. </template>
  9. <script setup>
  10. import { ref } from 'vue';
  11. const emit = defineEmits(['approve']);
  12. const showConfirmModal = ref(false);
  13. const handleApprove = () => {
  14. showConfirmModal.value = true;
  15. };
  16. const confirmApprove = () => {
  17. emit('approve');
  18. showConfirmModal.value = false;
  19. };
  20. </script>