Skip to content

mpvue组件,暂时包含popup,轻提示toast等9个组件

Notifications You must be signed in to change notification settings

JRliu/mpvue-component

Repository files navigation

mpvue-component

mpvue 组件库

---- ## toast

usage

<!-- template 内引入组件,并设置ref -->
<toast ref='toast'></toast>

<!-- script 内引入组件 -->
import toast from '@/components/toast'

<!-- 执行组件里的方法 -->
...
this.$refs.toast.toast('hello')
或
this.$refs.toast.toast({
  text: 'haha',
  position: 'top',
  duration: 3000
})
参数 说明 类型 可选值 默认值
text 文字内容 String - -
position 位置 String center,top,bottom bottom
duration 持续时间 Number - 3000

popup

usage

<!-- template 内引入组件,设置ref,填充插槽内容 -->
<popup ref="leftPopup"  type="left">
  <p>哈哈哈</p>
</popup>

<!-- script 内引入组件 -->
import toast from '@/components/popup'

<!-- 执行组件里的方法 -->
...
this.$refs.leftPopup.toggle('show')
参数 说明 类型 可选值 默认值
type (prop) 类型 String center,top,left,right,bottom center
isShow (组件toggle方法的参数) 是否显示 String show,hide -
mask(prop) 是否显示mask Boolean true,false true
duration(prop,mask为false时生效) popup持续时间 Number - 2500
class-name 传入class String -

About

mpvue组件,暂时包含popup,轻提示toast等9个组件

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published