<template>
  <div>
    <div class="wrap">
      <lyf-button weak @click="show(1)">仅文字</lyf-button>
      <lyf-button @click="show(2)">仅图标</lyf-button>
      <lyf-button weak @click="show(3)">图标+文字1</lyf-button>
      <lyf-button @click="show(4)">图标+文字2</lyf-button>
      <lyf-button weak @click="show">带按钮的toast</lyf-button>
    </div>
  </div>
</template>

<script>
export default {
  methods: {
    show(n) {
      let message
      switch (n) {
        case 1:
          message = 'Toast提示'
          this.lyfToast(message)
          break
        case 2:
          // message = '注意注意'
          this.lyfToast({
            icon: 'notice'
          })
          break
        case 3:
          message = '修改成功'
          this.lyfToast({
            message,
            icon: 'success'
          })
          break
        case 4:
          message = '请求失败'
          this.lyfToast({
            message,
            icon: 'close'
          })
          break
        default:
          message = '带按钮的吐司'
          this.lyfToast({
            message,
            btnText: '去看看',
          })
          break
      }
    },
    hide() {
      this.lyfHideToast()
    },
  }
}
</script>