1 | import { isDev } from './is-dev';
|
2 | export function devWarning(component, message) {
|
3 | if (isDev) {
|
4 | console.warn(`[antd-mobile: ${component}] ${message}`);
|
5 | }
|
6 | }
|
7 | export function devError(component, message) {
|
8 | if (isDev) {
|
9 | console.error(`[antd-mobile: ${component}] ${message}`);
|
10 | }
|
11 | }
|
12 | let infoBox;
|
13 | export function devPrint(...message) {
|
14 | if (isDev) {
|
15 | if (!infoBox) {
|
16 | infoBox = document.createElement('textarea');
|
17 | document.body.append(infoBox);
|
18 | infoBox.style.position = 'fixed';
|
19 | infoBox.style.top = '0';
|
20 | infoBox.style.left = '0';
|
21 | infoBox.style.width = '100vw';
|
22 | infoBox.style.height = '100vh';
|
23 | infoBox.style.zIndex = '999999';
|
24 | infoBox.style.fontSize = '12px';
|
25 |
|
26 | infoBox.style.pointerEvents = 'none';
|
27 | infoBox.style.background = 'transparent';
|
28 | infoBox.style.textShadow = '-1px -1px 0 #FFF, -1px 1px 0 #FFF, 1px -1px 0 #FFF, 1px 1px 0 #FFF';
|
29 | }
|
30 | infoBox.value = `${infoBox.value}\n${message.join(' ')}`.trim();
|
31 | infoBox.scrollTop = infoBox.scrollHeight;
|
32 | }
|
33 | } |
\ | No newline at end of file |