<template>
  <view>

    <!-- 提示信息弹窗 -->
    <uni-popup ref="messageRef" type="message">
      <uni-popup-message
        :type="msgType"
        :message="messageText"
        :duration="duration"
      ></uni-popup-message>
    </uni-popup>
  </view>
</template>

<script setup>
import { ref } from "vue";


const props = defineProps({
  msgType: {
    type: String,
    default: "success", // success, error, warning, info
  },
  messageText: {
    type: String,
    default: "",
  },
  duration: {
    type: Number,
    default: 3000,
  },
});

const messageRef = ref(null);

const openMessage = () => {
  messageRef.value.open();
};

defineExpose({
  openMessage,
});
</script>

<style lang="scss" scoped>

</style>