类toast提示窗口,但只显示文字,可调整显示位置
类toast提示窗口,但只显示文字,可调整显示位置。用于小程序wepy框架
DemoInstall
npm i spore-wepy-tipbox
Example:
<style lang="less"></style> <template> <view class="container"> <button @tap="showTip" size="mini" data-pos="center">显示到中间</button> <button @tap="showTip" size="mini" data-pos="top">显示到上方</button> <button @tap="showTip" size="mini" data-pos="bottom">显示到下方</button> <tip /> </view> </template> <script> import wepy from 'wepy'; import TipBox from 'spore-wepy-tipbox'; export default class Index extends wepy.page { config = { navigationBarTitleText: '首页' }; components = { tip: TipBox }; methods = { showTip(evt) { let pos = evt.currentTarget.dataset.pos; this.$invoke('tip', 'show', 'position:' + pos, { position: pos }); } }; } </script> Parameters text
Type: String
要显示的文案
optionsType: Object
tipbox 浮层选项
options.positionType: String
tipbox 浮层显示位置,可选值: ['top', 'bottom', 'center']
options.marginType: String
浮层与边界的距离,仅在 position 设置为 'top'
或者 'bottom'
时有效
Default: '20px'
Type: Number
浮层动画显示时长,单位为 ms
Default: 2000
版权声明:
1、该文章(资料)来源于互联网公开信息,我方只是对该内容做点评,所分享的下载地址为原作者公开地址。2、网站不提供资料下载,如需下载请到原作者页面进行下载。