haoneng.lhn
2023-12-08 acb9a0fec8d8a4dabeedcbb8e08c26f66d7083f0
1
2
3
4
5
6
7
8
9
10
11
12
export default {
    install (Vue) {
        // px 转 rem
        Vue.prototype.pxTorem = (px, needUnit) => {
            if (needUnit) {
                return px / 19.2 + 'rem'
            } else {
                return px / 19.2
            }
        }
    }
}