{{ min }}
{{ max }}
var util = require("../helpers/wxs/util.wxs")
module.exports = {
format: function(source, value) {
return source.replace(getRegExp('\{d\}', 'g'), value)
},
getTrackStyle: function(offsets, index, multiple) {
if (!multiple) {
return 'width: ' + offsets[index] + '%'
}
return 'left: ' + offsets[index] + '%; width: ' + (offsets[index + 1] - offsets[index]) + '%'
},
getStyle: function(style, index) {
if (util.type(style) !== 'string') {
return style[index]
}
return style
},
getValue: function(obj, name) {
if (util.type(obj) === 'object') {
return obj[name]
}
return obj
}
}