<template>
  <Button type="primary" @click="showLoading">显示（3秒以后关闭）</Button>
  <Loading :show="show"></Loading>
</template>

<script>
export default {
  methods: {
    showLoading() {
      this.show = true
      setTimeout(() => {
        this.show = false
      }, 3000)
    }
  },
  data() {
    return {
      show: false
    }
  }
}
</script>