123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- Component({
- externalClasses: ['tui-modal-class'],
- properties: {
- //是否显示
- show:{
- type:Boolean,
- value:false
- },
- //标题
- title: {
- type: String,
- value: ""
- },
- //内容
- content: {
- type: String,
- value: ""
- },
- //内容字体颜色
- color: {
- type: String,
- value: "#999"
- },
- //弹窗宽度
- width: {
- type: String,
- value: "580rpx"
- },
- top: {
- type: String,
- value: "40%"
- },
- background:{
- type: String,
- value: "#FFFFFF"
- },
- borderRadius:{
- type: String,
- value: "16rpx"
- },
- //内容字体大小
- size: {
- type: Number,
- value: 28
- },
- zIndex: {
- type: Number,
- value: 99998
- },
- //形状 circle, square
- shape: {
- type: String,
- value: 'square'
- },
- button: {
- type: Array,
- value: [{
- text: "取消",
- type: "red",
- plain: true //是否空心
- }, {
- text: "确定",
- type: "red",
- plain: false
- }]
- },
- //点击遮罩 是否可关闭
- maskClosable: {
- type: Boolean,
- value: true
- },
- //自定义弹窗内容
- custom:{
- type:Boolean,
- value:false
- },
- //淡入效果,自定义弹框插入input输入框时传true
- fadein: {
- type: Boolean,
- value: false
- }
- },
- data: {
- },
- methods: {
- handleClick(e) {
- if (!this.data.show) return;
- const dataset = e.currentTarget.dataset;
- this.triggerEvent('click', {
- index: Number(dataset.index)
- });
- },
- handleClickCancel() {
- if(!this.data.maskClosable) return;
- this.triggerEvent('cancel');
- },
- forbid(){}
- }
- })
|