# Toast 弹出式提示
弹出式提示,仅支持插件模式。
# 基本用法
<wx-button @click="showToast1" type="light">文本提示</wx-button>
<script>
export default {
  methods: {
    showToast1() {
      this.$toast("只支持插件模式");
    }
  }
};
</script>
# 提示类型
<wx-button @click="showToast2('提交成功', 'success')" type="light">成功提示</wx-button>
<wx-button @click="showToast2('提交失败', 'fail')" type="light">失败提示</wx-button>
<script>
export default {
  methods: {
    showToast2(msg, type) {
      this.$toast(msg, { type });
    }
  }
};
</script>
# 显示时长
<wx-button @click="showToast3" type="light">显示4s</wx-button>
<script>
export default {
  methods: {
    showToast3() {
      this.$toast("4s后自动消失", { time: 4000 });
    }
  }
};
</script>
# 长文本
<wx-button @click="showToast4" type="light">200px长度</wx-button>
<script>
export default {
  methods: {
    showToast4() {
      this.$toast("尽可能保持提示文本不换行~", { width: 200 });
    }
  }
};
</script>
# Toast Attributes
| 参数 | 说明 | 类型 | 可选值 | 默认值 | 
|---|---|---|---|---|
| type | 提示类型 | String | success,fail,text | text | 
| time | 显示时长,单位ms | Number | - | 2000 | 
| width | 提示长度,单位px | String/Number | - | 120 | 

弹出式提示