project init & fix ui
This commit is contained in:
25
miniprogram_npm/tdesign-miniprogram/slider/slider.wxs
Normal file
25
miniprogram_npm/tdesign-miniprogram/slider/slider.wxs
Normal file
@@ -0,0 +1,25 @@
|
||||
var REGEXP = getRegExp('[$][{value}]{7}');
|
||||
|
||||
function getValue(label, value) {
|
||||
if (label && label === 'true') return value;
|
||||
if (REGEXP.test(label)) return label.replace(REGEXP, value);
|
||||
}
|
||||
|
||||
function getColor(disable, active, disabledColor, colors) {
|
||||
var index = active ? 0 : 1;
|
||||
|
||||
if (disable && disabledColor.constructor === 'Array' && disabledColor.length == 2) {
|
||||
return 'background-color: ' + disabledColor[index];
|
||||
}
|
||||
|
||||
if (!disable && colors.constructor === 'Array' && colors.length == 2) {
|
||||
return 'background-color: ' + colors[index];
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
getValue: getValue,
|
||||
getColor: getColor,
|
||||
};
|
||||
Reference in New Issue
Block a user