(translate3d, type, value)
| 854 | window.parent.postMessage(params, '*') // 用 iframe 外的toast 防止iframe过大 导致toast显示位置不对 |
| 855 | }, |
| 856 | setTranslate3d(translate3d, type, value) { |
| 857 | // 设置元素的translate3d属性值 |
| 858 | if (translate3d === '') { |
| 859 | translate3d = 'translate3d(0px,0px,0px)' |
| 860 | } |
| 861 | const x = translate3d.substring(12).split('px')[0] |
| 862 | const y = translate3d.substring(12).split('px')[1].substring(2) |
| 863 | if (!String(value).includes('%')) { |
| 864 | value += 'px' |
| 865 | } |
| 866 | if (type === 'left') { |
| 867 | return `translate3d(${value},${y}px,0px)` |
| 868 | } |
| 869 | if (type === 'top') { |
| 870 | return `translate3d(${x}px,${value},0px)` |
| 871 | } |
| 872 | } |
| 873 | } |
| 874 | }) |
nothing calls this directly
no outgoing calls
no test coverage detected