parent
2c3366feb0
commit
a508224d59
@ -0,0 +1,21 @@ |
||||
export class Commons { |
||||
// 页面高度=屏幕的高度/2
|
||||
height = 'height:' + screen.height / 2 + 'px'; |
||||
|
||||
message = null; |
||||
messageStyle = 'warning'; |
||||
|
||||
// 清空警告信息
|
||||
clearError() { |
||||
this.message = null; |
||||
} |
||||
|
||||
// post请求
|
||||
request(url, b, res) { |
||||
const header = new Headers(); |
||||
header.append('Content-Type', 'application/json'); |
||||
const req = new Request(url, |
||||
{method: 'POST', body: b, headers: header}); |
||||
fetch(req).then(r => r.json()).then(res); |
||||
} |
||||
} |
@ -1,4 +0,0 @@ |
||||
export class Height { |
||||
// 页面高度=屏幕的高度/2
|
||||
height = 'height:' + screen.height / 2 + 'px'; |
||||
} |
Loading…
Reference in new issue