rpx2px
This commit is contained in:
parent
c91cbe2631
commit
1f87ba2dbd
|
@ -1,8 +1,8 @@
|
|||
import omi from 'omi'
|
||||
|
||||
function App() {}
|
||||
function App() { }
|
||||
|
||||
function getApp() {}
|
||||
function getApp() { }
|
||||
|
||||
function Page(option) {
|
||||
return option
|
||||
|
@ -12,9 +12,33 @@ function Component(option) {
|
|||
return option
|
||||
}
|
||||
|
||||
function noop() {}
|
||||
function noop() { }
|
||||
const wx = {}
|
||||
wx.canIUse = noop
|
||||
wx.canIUse = function () {
|
||||
return false
|
||||
}
|
||||
|
||||
wx.getSystemInfoSync = function () {
|
||||
return {
|
||||
windowWidth: window.innerWidth,
|
||||
windowHeight: window.innerHeight
|
||||
}
|
||||
}
|
||||
|
||||
`width: 128rpx;
|
||||
height: 54rpx;`.replace(/([0-9]*)(rpx)/g,function(a,b,c){
|
||||
console.log(a,b,c)
|
||||
|
||||
|
||||
return Number(b)
|
||||
})
|
||||
|
||||
//用户可以有个开关不转
|
||||
window.rpx2px = function(str){
|
||||
return str.replace(/([0-9]*)rpx/g,function(a,b,c){
|
||||
console.log(a,b,c)
|
||||
})
|
||||
}
|
||||
|
||||
window.wx = wx
|
||||
window.App = App
|
||||
|
|
Loading…
Reference in New Issue