<template>
  <demo-section>
    <demo-block title="">
      <drip-button @click="showLoading">loading</drip-button>
      <drip-button @click="showLoading2">loading2</drip-button>
      <drip-button @click="showLoading3">line</drip-button>

      <!-- <drip-loading :show="true" :type="'line'"></drip-loading> -->
    </demo-block>
  </demo-section>
</template>

<script>
export default {
  methods: {
    showLoading () {
      this.$loading.show()

      setTimeout(() => {
        this.$loading.hide()
      }, 3000)
    },
    showLoading2 () {
      this.$loading.show({
        text: '自定义内容'
      })

      setTimeout(() => {
        this.$loading.hide()
      }, 3000)
    },
    showLoading3 () {
      this.$loading.show({
        type: 'line'
      })

      setTimeout(() => {
        this.$loading.hide()
      }, 3000)
    }
  }
}
</script>

<style lang="postcss">
.demo-loading {
  .van-loading {
    display: inline-block;
    margin: 5px 0 5px 20px;
  }

  .van-doc-demo-block {
    padding: 0 15px;
  }

  .van-loading--white {
    padding: 10px;
    border-radius: 3px;
    background-color: rgba(0, 0, 0, .5);
  }
}
</style>
