Toast 轻提示

使用指南

import { Toast } from 'fs-ui'
1

代码演示

文字提示

Toast({
  type: 'text',
  message: '提示文案'
})
1
2
3
4

加载提示

Toast({
  type: 'loading',
  message: '加载中',
  overlay: true
})
1
2
3
4
5

成功/失败提示

Toast({
  type: 'success',
  message: '成功提示',
})
this.$toast({
  type: 'fail',
  message: '失败提示',
})
1
2
3
4
5
6
7
8

插件的方式调用

export default {
  mounted () {
    this.$toast('提示文案')
  }
}
1
2
3
4
5

方法

方法名 参数 返回值 说明
Toast options toast实例 展示提示

参数

参数 说明 类型 默认值
type 提示类型,可选值为 success fail text String text
overlay 遮罩层 Boolean false
message 内容 String -
duration 时间 Number 2000
position 位置,可选值为 top middle bottom String middle
value 是否显示toast Boolean true

插槽

插槽名 说明
默认插槽 默认slot, 提示内容