README.md 1.18 KB
Newer Older
Nature's avatar
Nature committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
Notify 通知提醒 插件和组件形式调用

```html
    <h2 class="item-title">notify</h2>
    <div class="local-region">
      <notify v-model="show1" content="提示内容"/>
      <notify v-model="show2" :time="3000" position="bottom" content="提示内容"/>
    </div>
    
    <h2 class="item-title">notify标签用法 (通常在局部显示时使用)</h2>
    <h-button class="button-class" type="rimless" shadow @click.native="showNotifyAtTop">Notify (top)</h-button>
    <h-button class="button-class" type="rimless" shadow @click.native="showNotifyAtBottom">Notify (bottom)</h-button>
    
    
    // 标签用法
    showNotifyAtTop() {
      if (this.show1) return
         this.show1 = true
      },
    showNotifyAtBottom() {
      if (this.show2) return
         this.show2 = true
      },
    // 插件用法
     showNotify(ops = {}) {
       hlsPopup.showNotify({
              content: ops.content,
              position: ops.position,
              time: ops.time
            })
          },
          handleNotify() {
            this.showNotify({
              content: '提示内容',
              position: 'top',
              time: 2000
            })
          },
      
```