<template>
  <div class="h100 w100">
    <zgh-header :title="$route.name"></zgh-header>
    <div class="common-top mainBox">
      <!------------强大的分割线-------------->
      <button class="common-btn mg20" @click="showLoading">Loading</button>
      <div class="highlight mgB30">
        <div class="wp fs14">
          <p>
            显示：this.$loading.show()
          </p>
          <p>
            隐藏：this.$loading.close()
          </p>
          <pre>
            <code class="hljs language-html">
    <h3 class="bold fs16">本例用法：</h3>
              {{code | htmlDecode}}
            </code>
          </pre>
          <h3 class="bold color3 textC pdB20">options参数说明</h3>
          <zgh-table :tbody="tbody"></zgh-table>
        </div>
      </div>
    </div>
  </div>
</template>

<script>

  export default {
    data() {
      return {
        n: 0,
        tbody: [
          {name: 'message', explain: '提示文字', type: 'String', default: ''},
          {name: 'onHide', explain: '隐藏Loading', type: 'Function', default: ''},
          {name: 'onShow', explain: '显示Loading', type: 'Function', default: ''}
        ],
        code: `
        this.$loading.show({message:'加载中...'});
        setTimeout(()=>{
          this.$loading.close();
        },2000)`
      }
    },
    computed: {},
    mounted() {
    },
    methods: {
      showLoading() {
        this.$loading.show({message:'加载中...'});
        setTimeout(()=>{
          this.$loading.close();
        },2000)
      }
    }
  }
</script>

<style lang="less" scoped>
  @import url("../../assets/config.less");

  a {
    display: block;
    text-align: center;
    .lh(70);
  }
</style>
