text: export function hasClass(el, className) { //判断是否拥有某个类名
      let reg = new RegExp('(^|\\s)' + className + '(\\s|$)')
      return reg.test(el.className)
  }
  
  export function addClass(el, className) { //添加类名
      if (hasClass(el, className)) {
          return;
      }
      let newClass = el.className.split(' ');
      newClass.push(className);
      el.className = newClass.join(' ')
  }
  
  export function getData(el, name, val) {//设置和获取自定义数据
      const prefix = 'data-'
      if (val) {
          return el.setAttribute(prefix + name, val)
      }
      return el.getAttribute(prefix + name)
  }
  
  let elementStyle = document.createElement('div').style;
  let vendor = (() => {
      let transformNames = {
          webkit: 'webkitTransform',
          Moz: 'MozTransform',
          O: 'OTransform',
          ms: 'msTransform',
          standard: 'transform'
      };
      for (let key in transformNames) {
          if (elementStyle[transformNames[key]] !== undefined) {
              return key
          }
      }
      return false
  })();
  
  export function prefixStyle(style) { // 添加类名前缀功能
      if (vendor === false) {
          return false
      }
      if (vendor === 'standard') {
          return style
      }
      return vendor + style.charAt(0).toUpperCase() + style.substr(1)
  }