index.js 213 B

1234567891011
  1. /**
  2. * 为样式动态赋值
  3. * @param {*} style
  4. */
  5. export function obj2style(style) {
  6. let str = [];
  7. Object.keys(style).forEach(key => {
  8. str.push(`${key}:${style[key]};`);
  9. });
  10. return str.join(';');
  11. }