<template>
  <div class="h100 w100">
    <zgh-header :title="$route.name"></zgh-header>
    <div class="common-top mainBox">
      <!------------强大的分割线-------------->
      <button class="common-btn mg20" @click="showAlert">Alert</button>
      <div class="highlight mgB30">
        <div class="wp fs14">
          <p>
            显示：this.$alert.show(options)
          </p>
          <p>
            隐藏：this.$alert.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 {
    name: 'alert-md',
    data() {
      return {
        n: 0,
        tbody: [
          {name: 'message', explain: '提示文字', type: 'String', default: ''},
          {name: 'isMaskClick', explain: '点击遮罩是否隐藏', type: 'Boolean', default: 'false'},
          {name: 'styles', explain: '新增自定义样式', type: 'Object', default: ''},
          {name: 'onHide', explain: '隐藏Alert', type: 'Function', default: ''},
          {name: 'onShow', explain: '显示Alert', type: 'Function', default: ''}
        ],
        code: `
        showAlert() {
          this.$alert.show({
            message: 'message',
            onShow: () => {
              console.log(this)
            },
            onHide: () => {
              this.$alert.close()
            }
          })
        }`
      }
    },
    computed: {},
    mounted() {
    },
    methods: {
      showAlert() {
        this.$alert.show({
          message: '订单提交成功，现在只差最后一步啦！',
          onShow: () => {
            console.log(this)
          },
          onHide: () => {
            this.$alert.close()
          }
        })
      }
    }
  }
</script>

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

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