ce4c83ff
wxy
初始提交
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
let device = void 0
const TOUCH_STATE = ['touchstarted', 'touchmoved', 'touchended']
export function firstLetterUpper (str) {
return str.charAt(0).toUpperCase() + str.slice(1)
}
export function setTouchState (instance, ...arg) {
TOUCH_STATE.forEach((key, i) => {
if (arg[i] !== undefined) {
instance[key] = arg[i]
}
})
}
export function validator (instance, o) {
Object.defineProperties(instance, o)
}
export function getDevice () {
if (!device) {
device = wx.getSystemInfoSync()
}
return device
}
|