UNPKG
motion-plus-vue
Version:
latest (1.8.1)
1.8.1
1.8.0
1.7.0
1.6.0
1.5.1
1.5.0
1.5.0-beta.1
1.4.0
1.3.1
1.3.0
1.2.1
1.2.0
1.2.0-beta.1
1.2.0-alpha.0
1.1.6
1.1.5
1.1.4
1.1.3
1.1.2
1.1.1
1.1.0
1.0.1
1.0.0
0.1.0
0.0.2
0.0.1
Motion Plus Vue
motion-plus-vue
/
dist
/
es
/
components
/
AnimateNumber
/
utils
/
get-width-in-ems.mjs
8 lines
(7 loc)
•
154 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
function
n
(
t
) {
const
{
width
: e,
fontSize
: o } =
getComputedStyle
(t);
return
`
${
parseFloat
(e) /
parseFloat
(o)}
em`
; }
export
{ n
as
getWidthInEm };