gy-app-shop/utils/mapCalculate.js

8 lines
173 B
JavaScript

// 处理多次点击
function getLenPx(str, fontSize) {
const str_leng = str.replace(/[^\x00-\xff]/gi, 'aa').length;
return str_leng * fontSize / 2
}
export {
getLenPx
}