@baic/yolk-cli 2.1.0-alpha.212 → 2.1.0-alpha.214
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/yolk.js +1 -1
- package/lib/yolk.js +1 -1
- package/package.json +3 -4
- package/templates/umi-mobile-uni-app/.eslintrc.js +7 -0
- package/templates/umi-mobile-uni-app/.gitignore.tpl +37 -0
- package/templates/umi-mobile-uni-app/.npmrc.tpl +2 -0
- package/templates/umi-mobile-uni-app/.prettierignore +12 -0
- package/templates/umi-mobile-uni-app/.prettierrc.js +1 -0
- package/templates/umi-mobile-uni-app/.stylelintrc +3 -0
- package/templates/umi-mobile-uni-app/.umirc.ts.tpl +7 -0
- package/templates/umi-mobile-uni-app/LICENSE +21 -0
- package/templates/umi-mobile-uni-app/README.md.tpl +34 -0
- package/templates/umi-mobile-uni-app/package.json.tpl +16 -0
- package/templates/umi-mobile-uni-app/public/favicon.ico +0 -0
- package/templates/umi-mobile-uni-app/src/app.tsx +19 -0
- package/templates/umi-mobile-uni-app/src/common/request.ts +3 -0
- package/templates/umi-mobile-uni-app/src/common/util.ts +7 -0
- package/templates/umi-mobile-uni-app/src/components/index.ts +0 -0
- package/templates/umi-mobile-uni-app/src/global.less +3 -0
- package/templates/umi-mobile-uni-app/src/layouts/index.tsx +3 -0
- package/templates/umi-mobile-uni-app/src/pages/404.tsx +9 -0
- package/templates/umi-mobile-uni-app/src/pages/demo/examples/BarCode.tsx +3 -0
- package/templates/umi-mobile-uni-app/src/pages/demo/examples/Iconfont.tsx +17 -0
- package/templates/umi-mobile-uni-app/src/pages/demo/examples/Input.tsx +15 -0
- package/templates/umi-mobile-uni-app/src/pages/demo/examples/List/1.tsx +11 -0
- package/templates/umi-mobile-uni-app/src/pages/demo/examples/List/2.tsx +29 -0
- package/templates/umi-mobile-uni-app/src/pages/demo/examples/List/3.tsx +29 -0
- package/templates/umi-mobile-uni-app/src/pages/demo/examples/List/4.tsx +54 -0
- package/templates/umi-mobile-uni-app/src/pages/demo/examples/List/mock.ts +30 -0
- package/templates/umi-mobile-uni-app/src/pages/demo/examples/Loading.tsx +11 -0
- package/templates/umi-mobile-uni-app/src/pages/demo/examples/NumberInput/1.tsx +15 -0
- package/templates/umi-mobile-uni-app/src/pages/demo/examples/NumberInput/2.tsx +15 -0
- package/templates/umi-mobile-uni-app/src/pages/demo/examples/NumberInput/3.tsx +15 -0
- package/templates/umi-mobile-uni-app/src/pages/demo/examples/NumberInput/4.tsx +15 -0
- package/templates/umi-mobile-uni-app/src/pages/demo/examples/PagingList/1.tsx +5 -0
- package/templates/umi-mobile-uni-app/src/pages/demo/examples/QrCode.tsx +3 -0
- package/templates/umi-mobile-uni-app/src/pages/demo/examples/Required.tsx +3 -0
- package/templates/umi-mobile-uni-app/src/pages/demo/examples/TimerButton.tsx +3 -0
- package/templates/umi-mobile-uni-app/src/pages/demo/examples/usePreload.tsx +9 -0
- package/templates/umi-mobile-uni-app/src/pages/demo/index.tsx +87 -0
- package/templates/umi-mobile-uni-app/src/pages/index.tsx +1 -0
- package/templates/umi-mobile-uni-app/src/types/user.d.ts +3 -0
- package/templates/umi-mobile-uni-app/tsconfig.json +3 -0
- package/templates/umi-mobile-uni-app/typings.d.ts +1 -0
- package/templates/umi-mobile-uni-app/uni-app/AndroidManifest.xml +8 -0
- package/templates/umi-mobile-uni-app/uni-app/App.vue +28 -0
- package/templates/umi-mobile-uni-app/uni-app/androidPrivacy.json +22 -0
- package/templates/umi-mobile-uni-app/uni-app/assets/apple-app-site-association +11 -0
- package/templates/umi-mobile-uni-app/uni-app/common/constants.ts +5 -0
- package/templates/umi-mobile-uni-app/uni-app/common/request.ts +118 -0
- package/templates/umi-mobile-uni-app/uni-app/common/util.ts +27 -0
- package/templates/umi-mobile-uni-app/uni-app/components/webview/webview.vue +61 -0
- package/templates/umi-mobile-uni-app/uni-app/hybrid/html/error.html +24 -0
- package/templates/umi-mobile-uni-app/uni-app/images/index.ts +2 -0
- package/templates/umi-mobile-uni-app/uni-app/index.html +20 -0
- package/templates/umi-mobile-uni-app/uni-app/info.plist +6 -0
- package/templates/umi-mobile-uni-app/uni-app/main.js +22 -0
- package/templates/umi-mobile-uni-app/uni-app/manifest.json +207 -0
- package/templates/umi-mobile-uni-app/uni-app/pages/index/index.vue +17 -0
- package/templates/umi-mobile-uni-app/uni-app/pages/webview/index.vue +19 -0
- package/templates/umi-mobile-uni-app/uni-app/pages.json +22 -0
- package/templates/umi-mobile-uni-app/uni-app/uni.promisify.adaptor.js +16 -0
- package/templates/umi-mobile-uni-app/uni-app/uni.scss +76 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Form, NumberInput, useForm } from '@baic/yolk-mobile';
|
|
2
|
+
|
|
3
|
+
export default () => {
|
|
4
|
+
const [form] = useForm();
|
|
5
|
+
const { createFormItem } = form;
|
|
6
|
+
return (
|
|
7
|
+
<Form form={form}>
|
|
8
|
+
{createFormItem({
|
|
9
|
+
label: 'zeroStart',
|
|
10
|
+
name: 'NumberInput',
|
|
11
|
+
rules: 'required',
|
|
12
|
+
})(<NumberInput zeroStart />)}
|
|
13
|
+
</Form>
|
|
14
|
+
);
|
|
15
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Form, NumberInput, useForm } from '@baic/yolk-mobile';
|
|
2
|
+
|
|
3
|
+
export default () => {
|
|
4
|
+
const [form] = useForm();
|
|
5
|
+
const { createFormItem } = form;
|
|
6
|
+
return (
|
|
7
|
+
<Form form={form}>
|
|
8
|
+
{createFormItem({
|
|
9
|
+
label: 'negative',
|
|
10
|
+
name: 'NumberInput',
|
|
11
|
+
rules: 'required',
|
|
12
|
+
})(<NumberInput negative />)}
|
|
13
|
+
</Form>
|
|
14
|
+
);
|
|
15
|
+
};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { isFunction, isObject } from 'lodash';
|
|
2
|
+
|
|
3
|
+
import type { FunctionComponent } from 'react';
|
|
4
|
+
import { createElement } from 'react';
|
|
5
|
+
|
|
6
|
+
import { Collapse, Tabs } from 'antd-mobile';
|
|
7
|
+
|
|
8
|
+
import BarCode from './examples/BarCode';
|
|
9
|
+
import Iconfont from './examples/Iconfont';
|
|
10
|
+
import Input from './examples/Input';
|
|
11
|
+
import List_1 from './examples/List/1';
|
|
12
|
+
import List_2 from './examples/List/2';
|
|
13
|
+
import List_3 from './examples/List/3';
|
|
14
|
+
import List_4 from './examples/List/4';
|
|
15
|
+
import Loading from './examples/Loading';
|
|
16
|
+
import NumberInput_1 from './examples/NumberInput/1';
|
|
17
|
+
import NumberInput_2 from './examples/NumberInput/2';
|
|
18
|
+
import NumberInput_3 from './examples/NumberInput/3';
|
|
19
|
+
import NumberInput_4 from './examples/NumberInput/4';
|
|
20
|
+
import PagingList_1 from './examples/PagingList/1';
|
|
21
|
+
import QrCode from './examples/QrCode';
|
|
22
|
+
import Required from './examples/Required';
|
|
23
|
+
import TimerButton from './examples/TimerButton';
|
|
24
|
+
import usePreload from './examples/usePreload';
|
|
25
|
+
|
|
26
|
+
const { Tab } = Tabs;
|
|
27
|
+
const { Panel } = Collapse;
|
|
28
|
+
|
|
29
|
+
const tabs: Record<
|
|
30
|
+
string,
|
|
31
|
+
FunctionComponent | Record<string, FunctionComponent>
|
|
32
|
+
> = {
|
|
33
|
+
BarCode,
|
|
34
|
+
Iconfont,
|
|
35
|
+
Input,
|
|
36
|
+
List: { List_1, List_2, List_3, List_4 },
|
|
37
|
+
Loading,
|
|
38
|
+
NumberInput: {
|
|
39
|
+
NumberInput_1,
|
|
40
|
+
NumberInput_2,
|
|
41
|
+
NumberInput_3,
|
|
42
|
+
NumberInput_4,
|
|
43
|
+
},
|
|
44
|
+
PagingList: {
|
|
45
|
+
PagingList_1,
|
|
46
|
+
},
|
|
47
|
+
QrCode,
|
|
48
|
+
Required,
|
|
49
|
+
TimerButton,
|
|
50
|
+
usePreload,
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export default () => {
|
|
54
|
+
const keys = Object.keys(tabs);
|
|
55
|
+
return (
|
|
56
|
+
<Tabs defaultActiveKey={keys[0]}>
|
|
57
|
+
{keys.map((key) => {
|
|
58
|
+
const tab = tabs[key];
|
|
59
|
+
if (isFunction(tab)) {
|
|
60
|
+
return (
|
|
61
|
+
<Tab key={key} title={key}>
|
|
62
|
+
{createElement(tab)}
|
|
63
|
+
</Tab>
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
if (isObject(tab)) {
|
|
67
|
+
const keys2 = Object.keys(tab);
|
|
68
|
+
return (
|
|
69
|
+
<Tab key={key} title={key}>
|
|
70
|
+
<Collapse accordion defaultActiveKey={keys2[0]}>
|
|
71
|
+
{keys2.map((key2) => {
|
|
72
|
+
const tab2 = tab[key2];
|
|
73
|
+
return (
|
|
74
|
+
<Panel key={key2} title={key2}>
|
|
75
|
+
{createElement(tab2)}
|
|
76
|
+
</Panel>
|
|
77
|
+
);
|
|
78
|
+
})}
|
|
79
|
+
</Collapse>
|
|
80
|
+
</Tab>
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
return null;
|
|
84
|
+
})}
|
|
85
|
+
</Tabs>
|
|
86
|
+
);
|
|
87
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default () => <div>Hello world</div>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@umijs/max/typings';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
export default {
|
|
3
|
+
onLaunch: function () {
|
|
4
|
+
// #ifndef APP-PLUS
|
|
5
|
+
console.log('App Launch');
|
|
6
|
+
// #endif
|
|
7
|
+
},
|
|
8
|
+
onShow: function () {
|
|
9
|
+
// #ifndef APP-PLUS
|
|
10
|
+
console.log('App Show');
|
|
11
|
+
// #endif
|
|
12
|
+
},
|
|
13
|
+
onHide: function () {
|
|
14
|
+
// #ifndef APP-PLUS
|
|
15
|
+
console.log('App Hide');
|
|
16
|
+
// #endif
|
|
17
|
+
},
|
|
18
|
+
methods: {
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<style lang="scss">
|
|
24
|
+
/*每个页面公共css */
|
|
25
|
+
// #ifndef APP-PLUS
|
|
26
|
+
|
|
27
|
+
// #endif
|
|
28
|
+
</style>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version" : "1.0.0",
|
|
3
|
+
"prompt" : "template",
|
|
4
|
+
"title" : "服务协议和隐私政策",
|
|
5
|
+
"message" : "请你务必审慎阅读、充分理解“服务协议”和“隐私政策”各条款,包括但不限于:为了更好的向你提供服务,我们需要收集你的设备标识、操作日志等信息用于分析、优化应用性能。<br/> 你可阅读<a href=\"\">《服务协议》</a>和<a href=\"\">《隐私政策》</a>了解详细信息。如果你同意,请点击下面按钮开始接受我们的服务。",
|
|
6
|
+
"buttonAccept" : "同意并接受",
|
|
7
|
+
"buttonRefuse" : "暂不同意",
|
|
8
|
+
"hrefLoader" : "default",
|
|
9
|
+
"backToExit" : "true",
|
|
10
|
+
"second" : {
|
|
11
|
+
"title" : "确认提示",
|
|
12
|
+
"message" : "进入应用前,你需先同意<a href=\"\">《服务协议》</a>和<a href=\"\">《隐私政策》</a>,否则将退出应用。",
|
|
13
|
+
"buttonAccept" : "同意并继续",
|
|
14
|
+
"buttonRefuse" : "退出应用"
|
|
15
|
+
},
|
|
16
|
+
"disagreeMode" : {
|
|
17
|
+
"support" : false,
|
|
18
|
+
"loadNativePlugins" : true,
|
|
19
|
+
"visitorEntry" : false,
|
|
20
|
+
"showAlways" : true
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { REQUEST_HOST } from './constants';
|
|
2
|
+
|
|
3
|
+
type Options = { baseURL: string };
|
|
4
|
+
|
|
5
|
+
export type RequestOptions = {
|
|
6
|
+
loading?: boolean;
|
|
7
|
+
message?: boolean;
|
|
8
|
+
needLogin?: boolean;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
type ResponseData<T = any> = {
|
|
12
|
+
code?: string | number;
|
|
13
|
+
success?: boolean;
|
|
14
|
+
message?: string;
|
|
15
|
+
data?: T;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export const getRandomString = (maxLength?: number): string => {
|
|
19
|
+
return `${Math.random()
|
|
20
|
+
.toString(36)
|
|
21
|
+
.substring(2, maxLength && maxLength >= 0 ? maxLength + 2 : 8)}`;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
class Request {
|
|
25
|
+
private options: Options;
|
|
26
|
+
constructor(options: Options) {
|
|
27
|
+
this.options = options;
|
|
28
|
+
}
|
|
29
|
+
private async request<T = any>(
|
|
30
|
+
url: string,
|
|
31
|
+
method: 'GET' | 'POST',
|
|
32
|
+
params?: Record<string, any>,
|
|
33
|
+
options?: RequestOptions,
|
|
34
|
+
) {
|
|
35
|
+
const { loading = true, message = true, needLogin = true } = options || {};
|
|
36
|
+
return new Promise<ResponseData<T>>((resolve, reject) => {
|
|
37
|
+
if (loading) {
|
|
38
|
+
uni.showLoading({
|
|
39
|
+
title: '加载中',
|
|
40
|
+
mask: true,
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
const header: Record<string, string> = {};
|
|
44
|
+
uni.request({
|
|
45
|
+
url: `${!/https?/u.test(url) ? this.options.baseURL : ''}${url}${
|
|
46
|
+
url?.indexOf('?') > 0 ? '&' : '?'
|
|
47
|
+
}t=${getRandomString(4)}`,
|
|
48
|
+
method,
|
|
49
|
+
data: params,
|
|
50
|
+
header,
|
|
51
|
+
success(e) {
|
|
52
|
+
const { data, statusCode } = e;
|
|
53
|
+
if (loading) {
|
|
54
|
+
uni.hideLoading();
|
|
55
|
+
}
|
|
56
|
+
if (statusCode === 200) {
|
|
57
|
+
const { success, message: errorMessage } = (data || {}) as any;
|
|
58
|
+
if (success) {
|
|
59
|
+
resolve(data as T);
|
|
60
|
+
} else {
|
|
61
|
+
if (message) {
|
|
62
|
+
uni.showToast({
|
|
63
|
+
icon: 'none',
|
|
64
|
+
title: errorMessage || '系统异常,请重试',
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
reject(data);
|
|
68
|
+
}
|
|
69
|
+
} else if (statusCode === 401) {
|
|
70
|
+
if (needLogin) {
|
|
71
|
+
uni.clearStorageSync();
|
|
72
|
+
} else {
|
|
73
|
+
resolve({} as T);
|
|
74
|
+
}
|
|
75
|
+
} else {
|
|
76
|
+
if (message) {
|
|
77
|
+
if (process.env.NODE_ENV === 'production') {
|
|
78
|
+
uni.showToast({
|
|
79
|
+
icon: 'none',
|
|
80
|
+
title: '系统异常,请重试',
|
|
81
|
+
});
|
|
82
|
+
} else {
|
|
83
|
+
uni.showModal({
|
|
84
|
+
title: String(statusCode),
|
|
85
|
+
content: JSON.stringify(e),
|
|
86
|
+
showCancel: false,
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
reject(data);
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
fail(e) {
|
|
94
|
+
if (loading) {
|
|
95
|
+
uni.hideLoading();
|
|
96
|
+
}
|
|
97
|
+
reject(e);
|
|
98
|
+
},
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
public get<T = any>(
|
|
103
|
+
url: string,
|
|
104
|
+
params?: Record<string, any>,
|
|
105
|
+
options?: RequestOptions,
|
|
106
|
+
) {
|
|
107
|
+
return this.request<T>(url, 'GET', params, options);
|
|
108
|
+
}
|
|
109
|
+
public post<T = any>(
|
|
110
|
+
url: string,
|
|
111
|
+
params?: Record<string, any>,
|
|
112
|
+
options?: RequestOptions,
|
|
113
|
+
) {
|
|
114
|
+
return this.request<T>(url, 'POST', params, options);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export default new Request({ baseURL: REQUEST_HOST });
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { getRandomString } from './request';
|
|
2
|
+
|
|
3
|
+
const util = {
|
|
4
|
+
getRandomString,
|
|
5
|
+
requestAndroidPermission(permission: string | string[]) {
|
|
6
|
+
return new Promise<void>((resolve, reject) => {
|
|
7
|
+
plus.android.requestPermissions(
|
|
8
|
+
Array.isArray(permission) ? permission : [permission],
|
|
9
|
+
({ granted }) => {
|
|
10
|
+
if (
|
|
11
|
+
Array.isArray(permission) &&
|
|
12
|
+
permission.every((item) => granted?.indexOf(item) >= 0)
|
|
13
|
+
) {
|
|
14
|
+
resolve();
|
|
15
|
+
} else if (granted?.indexOf(permission) >= 0) {
|
|
16
|
+
resolve();
|
|
17
|
+
} else {
|
|
18
|
+
reject();
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
reject,
|
|
22
|
+
);
|
|
23
|
+
});
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export default util;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<style scoped lang="scss">
|
|
2
|
+
</style>
|
|
3
|
+
<template>
|
|
4
|
+
<web-view v-if="!!src" ref="webview" :style="webviewStyle" :src="src" :update-title="true"
|
|
5
|
+
:webview-styles="webviewStyles" />
|
|
6
|
+
</template>
|
|
7
|
+
|
|
8
|
+
<script lang="ts">
|
|
9
|
+
export default {
|
|
10
|
+
name: "webview",
|
|
11
|
+
data() : {
|
|
12
|
+
webviewStyle ?: string;
|
|
13
|
+
src ?: string;
|
|
14
|
+
webviewStyles ?: {
|
|
15
|
+
progress ?: boolean | {
|
|
16
|
+
color ?: string;
|
|
17
|
+
};
|
|
18
|
+
},
|
|
19
|
+
} {
|
|
20
|
+
return {
|
|
21
|
+
webviewStyle: '',
|
|
22
|
+
src: '',
|
|
23
|
+
webviewStyles: {
|
|
24
|
+
progress: false,
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
},
|
|
28
|
+
props: {
|
|
29
|
+
url: {
|
|
30
|
+
type: String,
|
|
31
|
+
required: true,
|
|
32
|
+
},
|
|
33
|
+
data: {
|
|
34
|
+
type: Object,
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
watch: {
|
|
38
|
+
url: {
|
|
39
|
+
handler() {
|
|
40
|
+
this.init();
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
created() {
|
|
45
|
+
const { url } = this.$props;
|
|
46
|
+
if (!!url) {
|
|
47
|
+
this.init();
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
beforeDestroy() {
|
|
51
|
+
},
|
|
52
|
+
methods: {
|
|
53
|
+
init() {
|
|
54
|
+
const { url } = this.$props;
|
|
55
|
+
if (!!url) {
|
|
56
|
+
this.src = url;
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
}
|
|
61
|
+
</script>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
|
|
6
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
|
7
|
+
<meta name="renderer" content="webkit">
|
|
8
|
+
<meta name="format-detection" content="telephone=no">
|
|
9
|
+
<link rel="shortcut icon" href="/favicon.ico">
|
|
10
|
+
<title>xxx</title>
|
|
11
|
+
<style>
|
|
12
|
+
body {
|
|
13
|
+
margin: 0;
|
|
14
|
+
}
|
|
15
|
+
body * {
|
|
16
|
+
box-sizing: border-box;
|
|
17
|
+
word-wrap: break-word;
|
|
18
|
+
}
|
|
19
|
+
</style>
|
|
20
|
+
</head>
|
|
21
|
+
<body>
|
|
22
|
+
error
|
|
23
|
+
</body>
|
|
24
|
+
</html>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<script>
|
|
6
|
+
var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') ||
|
|
7
|
+
CSS.supports('top: constant(a)'))
|
|
8
|
+
document.write(
|
|
9
|
+
'<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' +
|
|
10
|
+
(coverSupport ? ', viewport-fit=cover' : '') + '" />')
|
|
11
|
+
</script>
|
|
12
|
+
<title></title>
|
|
13
|
+
<!--preload-links-->
|
|
14
|
+
<!--app-context-->
|
|
15
|
+
</head>
|
|
16
|
+
<body>
|
|
17
|
+
<div id="app"><!--app-html--></div>
|
|
18
|
+
<script type="module" src="/main.js"></script>
|
|
19
|
+
</body>
|
|
20
|
+
</html>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import App from './App';
|
|
2
|
+
|
|
3
|
+
// #ifndef VUE3
|
|
4
|
+
import Vue from 'vue';
|
|
5
|
+
import './uni.promisify.adaptor';
|
|
6
|
+
Vue.config.productionTip = false;
|
|
7
|
+
App.mpType = 'app';
|
|
8
|
+
const app = new Vue({
|
|
9
|
+
...App,
|
|
10
|
+
});
|
|
11
|
+
app.$mount();
|
|
12
|
+
// #endif
|
|
13
|
+
|
|
14
|
+
// #ifdef VUE3
|
|
15
|
+
import { createSSRApp } from 'vue';
|
|
16
|
+
export function createApp() {
|
|
17
|
+
const app = createSSRApp(App);
|
|
18
|
+
return {
|
|
19
|
+
app,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
// #endif
|