珠宝小程序前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

15 lines
344 B

const toLine = (name) => {
return name.replace(/([A-Z])/g, '-$1').toLowerCase();
}
/**
* style对象转化为style字符串
* @return {string}
*/
export const getStyleStr = (styleObject) => {
let transfrom = '';
for (let i in styleObject) {
let line = toLine(i);
transfrom += line + ':' + styleObject[i] + ';';
}
return transfrom
}