更新记录
1.0.1(2020-07-14) 下载此版本
更新插件包内容; 更新插件使用文档
1.0.0(2020-06-29) 下载此版本
aui-actionsheet操作弹窗首次发布
平台兼容性
actionsheet操作弹窗
使用时请下载查看完整示例
参数 | 类型 | 描述 | 默认值 | 必选 |
---|---|---|---|---|
items | arr | 菜单列表[{name: "", color: "", fontSize: "", textAlign: ""}] | [] | 否 |
mask | boolean | 是否显示遮罩蒙版 | true | 否 |
maskTapClose | boolean | 触摸遮罩是否关闭模态弹窗 | true | 否 |
cancle | string | 取消按钮 | '' | 否 |
location | string | 位置 bottom:位于底部,从底部弹出显示middle:位于页面中心位置 | 'bottom' | 否 |
theme | number | 主题样式(1: 非全屏宽度; 2: 全屏宽度) | 1 | 否 |
插件显示:
_this.$refs.actionsheet.show();
插件引入示例:
<button class="aui-btn aui-btn-blue" @click.top="showActionsheet($event)" data-title="上传图片" data-location="bottom" data-theme="1" data-cancel="取消">底部弹出操作菜单(上传图片)</button>
<button class="aui-btn aui-btn-blue" @click.top="showActionsheet($event)" data-title=" " data-location="middle" data-theme="2">页面中心弹出操作菜单(上传图片)</button>
<button class="aui-btn aui-btn-blue" @click.top="showActionsheet($event)" data-title=" " data-location="bottom" data-theme="2" data-cancel="取消">底部弹出操作菜单(全屏宽度)</button>
<aui-actionsheet
ref="actionsheet"
:title="auiActionsheet.title"
:mask="auiActionsheet.mask"
:maskTapClose="auiActionsheet.maskTapClose"
:items="auiActionsheet.items"
:location="auiActionsheet.location"
:theme="auiActionsheet.theme"
:cancel="auiActionsheet.cancel"
@callback="actionsheetCallback"
></aui-actionsheet>
<!-- 简单调用actionsheet -->
<!-- <aui-actionsheet
ref="actionsheet"
:items="auiActionsheet.items"
@callback="actionsheetCallback"
></aui-actionsheet> -->
import {aui} from '@/common/aui/js/aui.js';
import auiActionsheet from '@/components/aui-actionsheet/aui-actionsheet.vue';
export default {
components: {
auiActionsheet
},
data() {
return {
auiActionsheet: {
title: '',
mask: true,
theme: 1,
location: 'bottom',
items: [
{name: "拍照", color: "#333", fontSize: "16px", textAlign: "center"},
{name: '从相册选择'}
],
cancel: '取消'
}
}
},
methods: {
showActionsheet(e){
var _this = this;
aui.isDefine(e.currentTarget.dataset.title) ? _this.auiActionsheet.title = e.currentTarget.dataset.title : _this.auiActionsheet.title = '';
aui.isDefine(e.currentTarget.dataset.location) ? _this.auiActionsheet.location = e.currentTarget.dataset.location : _this.auiActionsheet.location = 'bottom';
aui.isDefine(e.currentTarget.dataset.theme) ? _this.auiActionsheet.theme = Number(e.currentTarget.dataset.theme) : _this.auiActionsheet.theme = 1;
aui.isDefine(e.currentTarget.dataset.cancel) ? _this.auiActionsheet.cancel = e.currentTarget.dataset.cancel : _this.auiActionsheet.cancel = '';
_this.$refs.actionsheet.show();
},
actionsheetCallback(e){
var _this = this;
console.log(e);
}
}
}