<template>
  <up-overlay :show="show">
    <view class="warp">
      <up-loading-icon :text="tip" textSize="18"></up-loading-icon>
    </view>
  </up-overlay>
</template>

<script setup lang="ts">
import {ref} from 'vue'

const show = ref(false)
const tip = ref("加载中...")
const load = ({
                msg = "数据正在提交..."
              }) => {
  show.value = true
  tip.value = msg
}
const end = () => {
  show.value = false
}

defineExpose({load, end})
</script>

<script lang="ts">
export default {
  options: {
    name: 'overlay-tip',
    styleIsolation: 'shared'
  }
}
</script>
<style scoped lang="scss">
.warp {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

</style>