审查视图

miniprogram_npm/@vant/weapp/wxs/add-unit.wxs 240 字节
倪静楠 authored
1 2 3 4 5 6 7 8 9 10 11 12 13 14
/* eslint-disable */
var REGEXP = getRegExp('^\d+(\.\d+)?$');

function addUnit(value) {
  if (value == null) {
    return undefined;
  }

  return REGEXP.test('' + value) ? value + 'px' : value;
}

module.exports = {
  addUnit: addUnit
};