@mucfe/matui
Version:
基于Vue和ElementUi的PC组件库
142 lines (137 loc) • 2.52 kB
JavaScript
"use strict";
exports.__esModule = true;
exports.default = void 0;
var _helpers = require("../utils/helpers");
var EVENT_TIPS_CLICK = 'tipsclick';
var _default2 = {
props: {
tit: {
type: String,
default: ''
},
subTit: {
type: String,
default: ''
},
tips: {
type: [String, Object],
default: ''
},
remarks: {
type: String,
default: ''
},
errMsg: {
type: String,
default: ''
},
value: {
type: [String, Object, Number, Array],
default: undefined
},
desc: {
type: [String, Number],
default: ''
},
type: {
type: String,
default: 'text'
},
placeholder: {
type: String,
default: ''
},
unit: {
type: String,
default: ''
},
options: {
type: Array,
default: function _default() {
return [];
}
},
range: {
type: Object,
default: function _default() {
return {
conMin: 1,
conMax: 1,
min: 1,
max: 1000,
step: 1
};
}
},
fontSize: {
type: [String, Number],
default: ''
},
color: {
type: String,
default: ''
},
align: {
type: String,
default: 'right'
},
colons: {
type: Boolean,
default: false
},
border: {
type: String,
default: 'none'
},
titPadding: {
type: Boolean,
default: false
},
zIndex: {
type: Number,
default: 100
},
brandColor: {
type: String,
default: '#8c7fee'
},
btnColor: {
type: String,
default: '#ff5a6e'
}
},
computed: {
common: function common() {
return {
tit: this.tit,
subTit: this.subTit,
tips: this.tips,
remarks: this.remarks,
errMsg: this.errMsg,
colons: this.colons,
align: this.align,
border: this.border,
titPadding: this.titPadding
};
},
size: function size() {
return (0, _helpers.formatFontSize)(this.fontSize);
}
},
methods: {
showTips: function showTips() {
if (this.tips) {
var tips = this.tips;
if ((0, _helpers.isString)(tips)) {
try {
tips = JSON.parse(tips);
} catch (e) {
return;
}
}
this.$emit(EVENT_TIPS_CLICK, tips);
}
}
}
};
exports.default = _default2;