@gx-design-vue/create-gx-cli 0.1.15 → 0.1.17
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/dist/index.js +62 -0
- package/index.js +3 -0
- package/package.json +22 -9
- package/bin/create-gx-cli +0 -5
- package/src/cli.js +0 -115
- package/src/git.js +0 -81
- package/src/main.js +0 -190
- package/template-mobile-vant-cli/.editorconfig +0 -19
- package/template-mobile-vant-cli/.env +0 -0
- package/template-mobile-vant-cli/.env.development +0 -19
- package/template-mobile-vant-cli/.env.pro +0 -19
- package/template-mobile-vant-cli/.env.production +0 -19
- package/template-mobile-vant-cli/.eslintignore +0 -15
- package/template-mobile-vant-cli/.prettierignore +0 -9
- package/template-mobile-vant-cli/README.md +0 -1
- package/template-mobile-vant-cli/build/cdn.ts +0 -5
- package/template-mobile-vant-cli/build/generateModifyVars.ts +0 -7
- package/template-mobile-vant-cli/build/optimizer.ts +0 -18
- package/template-mobile-vant-cli/build/plugin/autoImport.ts +0 -24
- package/template-mobile-vant-cli/build/plugin/html.ts +0 -26
- package/template-mobile-vant-cli/build/plugin/index.ts +0 -42
- package/template-mobile-vant-cli/build/plugin/mock.ts +0 -14
- package/template-mobile-vant-cli/build/plugin/viteMock/client.ts +0 -88
- package/template-mobile-vant-cli/build/plugin/viteMock/createMockServer.ts +0 -271
- package/template-mobile-vant-cli/build/plugin/viteMock/index.ts +0 -69
- package/template-mobile-vant-cli/build/plugin/viteMock/types.ts +0 -48
- package/template-mobile-vant-cli/build/plugin/viteMock/utils.ts +0 -48
- package/template-mobile-vant-cli/build/script/postBuild.ts +0 -14
- package/template-mobile-vant-cli/eslint.config.js +0 -49
- package/template-mobile-vant-cli/index.html +0 -24
- package/template-mobile-vant-cli/mock/_createProductionServer.ts +0 -19
- package/template-mobile-vant-cli/mock/datasSource/api/index.ts +0 -0
- package/template-mobile-vant-cli/mock/utils.ts +0 -9
- package/template-mobile-vant-cli/package.json +0 -57
- package/template-mobile-vant-cli/postcss.config.cjs +0 -8
- package/template-mobile-vant-cli/prettier.config.cjs +0 -18
- package/template-mobile-vant-cli/public/favicon.ico +0 -0
- package/template-mobile-vant-cli/public/js/flexible.js +0 -44
- package/template-mobile-vant-cli/src/App.vue +0 -5
- package/template-mobile-vant-cli/src/components/PageContainer/ProSkeleton.tsx +0 -29
- package/template-mobile-vant-cli/src/components/PageContainer/index.tsx +0 -115
- package/template-mobile-vant-cli/src/components/PageContainer/style.module.less +0 -14
- package/template-mobile-vant-cli/src/core/gx-design/index.ts +0 -7
- package/template-mobile-vant-cli/src/core/index.ts +0 -12
- package/template-mobile-vant-cli/src/core/vant-design/index.ts +0 -4
- package/template-mobile-vant-cli/src/design/config.less +0 -0
- package/template-mobile-vant-cli/src/design/index.less +0 -3
- package/template-mobile-vant-cli/src/design/reset.less +0 -155
- package/template-mobile-vant-cli/src/design/root.less +0 -3
- package/template-mobile-vant-cli/src/design/vant.less +0 -2
- package/template-mobile-vant-cli/src/global.less +0 -1
- package/template-mobile-vant-cli/src/hooks/web/index.ts +0 -5
- package/template-mobile-vant-cli/src/hooks/web/usePageLoading.ts +0 -58
- package/template-mobile-vant-cli/src/layout/BasicLayout.vue +0 -16
- package/template-mobile-vant-cli/src/layout/basicLayout.less +0 -11
- package/template-mobile-vant-cli/src/main.ts +0 -27
- package/template-mobile-vant-cli/src/pages/home.vue +0 -71
- package/template-mobile-vant-cli/src/router/index.ts +0 -25
- package/template-mobile-vant-cli/src/router/routes.ts +0 -20
- package/template-mobile-vant-cli/src/router/typings.ts +0 -8
- package/template-mobile-vant-cli/src/services/index.ts +0 -31
- package/template-mobile-vant-cli/src/settings/index.ts +0 -10
- package/template-mobile-vant-cli/src/store/index.ts +0 -17
- package/template-mobile-vant-cli/src/store/modules/global.ts +0 -30
- package/template-mobile-vant-cli/src/utils/crypto/base64.ts +0 -101
- package/template-mobile-vant-cli/src/utils/crypto/index.ts +0 -57
- package/template-mobile-vant-cli/src/utils/env.ts +0 -50
- package/template-mobile-vant-cli/src/utils/pageTitle.ts +0 -14
- package/template-mobile-vant-cli/src/utils/request/XHR.ts +0 -139
- package/template-mobile-vant-cli/src/utils/request/axiosCancel.ts +0 -69
- package/template-mobile-vant-cli/src/utils/request/checkStatus.ts +0 -9
- package/template-mobile-vant-cli/src/utils/request/index.ts +0 -142
- package/template-mobile-vant-cli/src/utils/request/typings.ts +0 -171
- package/template-mobile-vant-cli/src/utils/storage.ts +0 -198
- package/template-mobile-vant-cli/src/utils/util.ts +0 -27
- package/template-mobile-vant-cli/src/utils/validate.ts +0 -216
- package/template-mobile-vant-cli/tsconfig.json +0 -42
- package/template-mobile-vant-cli/types/ant-design-import.d.ts +0 -13
- package/template-mobile-vant-cli/types/auto-imports.d.ts +0 -64
- package/template-mobile-vant-cli/types/components.d.ts +0 -12
- package/template-mobile-vant-cli/types/global.d.ts +0 -39
- package/template-mobile-vant-cli/types/module.d.ts +0 -20
- package/template-mobile-vant-cli/types/plugins-auto-import.d.ts +0 -14
- package/template-mobile-vant-cli/types/response.d.ts +0 -15
- package/template-mobile-vant-cli/types/vant-import.d.ts +0 -13
- package/template-mobile-vant-cli/unocss.config.ts +0 -101
- package/template-mobile-vant-cli/vite.config.ts +0 -145
- package/template-mobile-vant-html/README.md +0 -4
- package/template-mobile-vant-html/css/global.css +0 -293
- package/template-mobile-vant-html/css/global.css.map +0 -1
- package/template-mobile-vant-html/css/global.less +0 -293
- package/template-mobile-vant-html/css/index.css +0 -20
- package/template-mobile-vant-html/css/index.css.map +0 -1
- package/template-mobile-vant-html/css/index.less +0 -21
- package/template-mobile-vant-html/image/disconnected.svg +0 -60
- package/template-mobile-vant-html/image/empty.svg +0 -52
- package/template-mobile-vant-html/image/error.svg +0 -53
- package/template-mobile-vant-html/image/loading.svg +0 -1
- package/template-mobile-vant-html/index.html +0 -91
- package/template-mobile-vant-html/js/index.js +0 -29
- package/template-mobile-vant-html/js/plugin/day.min.js +0 -1
- package/template-mobile-vant-html/js/plugin/fastclick.js +0 -730
- package/template-mobile-vant-html/js/plugin/jquery.min.js +0 -2
- package/template-mobile-vant-html/js/plugin/rem.js +0 -28
- package/template-mobile-vant-html/js/utils/appUtil.js +0 -70
- package/template-mobile-vant-html/js/utils/config.js +0 -3
- package/template-mobile-vant-html/js/utils/request.js +0 -61
- package/template-mobile-vant-html/js/utils/utils.js +0 -65
- package/template-mobile-vant-html/js/utils/validate.js +0 -292
@@ -1,48 +0,0 @@
|
|
1
|
-
import fs from 'node:fs'
|
2
|
-
|
3
|
-
const toString = Object.prototype.toString
|
4
|
-
|
5
|
-
export function is(val: unknown, type: string) {
|
6
|
-
return toString.call(val) === `[object ${type}]`
|
7
|
-
}
|
8
|
-
|
9
|
-
export function fileExists(f: string) {
|
10
|
-
try {
|
11
|
-
fs.accessSync(f, fs.constants.W_OK);
|
12
|
-
return true;
|
13
|
-
} catch (error) {
|
14
|
-
return false;
|
15
|
-
}
|
16
|
-
}
|
17
|
-
|
18
|
-
export function isFunction<T = Function>(val: unknown): val is T {
|
19
|
-
return is(val, 'Function') || is(val, 'AsyncFunction')
|
20
|
-
}
|
21
|
-
|
22
|
-
export function isArray(val: any): val is Array<any> {
|
23
|
-
return val && Array.isArray(val)
|
24
|
-
}
|
25
|
-
|
26
|
-
export function isRegExp(val: unknown): val is RegExp {
|
27
|
-
return is(val, 'RegExp')
|
28
|
-
}
|
29
|
-
|
30
|
-
export function isAbsPath(path: string | undefined) {
|
31
|
-
if (!path) {
|
32
|
-
return false
|
33
|
-
}
|
34
|
-
// Windows 路径格式:C:\ 或 \\ 开头,或已含盘符(D:\path\to\file)
|
35
|
-
if (/^([a-zA-Z]:\\|\\\\|(?:\/|\uFF0F){2,})/.test(path)) {
|
36
|
-
return true
|
37
|
-
}
|
38
|
-
// Unix/Linux 路径格式:/ 开头
|
39
|
-
return /^\/[^/]/.test(path)
|
40
|
-
}
|
41
|
-
|
42
|
-
export function sleep(time: number) {
|
43
|
-
return new Promise((resolve) => {
|
44
|
-
setTimeout(() => {
|
45
|
-
resolve('')
|
46
|
-
}, time)
|
47
|
-
})
|
48
|
-
}
|
@@ -1,14 +0,0 @@
|
|
1
|
-
// #!/usr/bin/env node
|
2
|
-
import chalk from 'chalk'
|
3
|
-
|
4
|
-
import pkg from '../../package.json'
|
5
|
-
|
6
|
-
export const runBuild = async () => {
|
7
|
-
try {
|
8
|
-
console.log(`✨ ${chalk.cyan(`[${pkg.name}]`)}` + ' - build successfully!')
|
9
|
-
} catch (error) {
|
10
|
-
console.log(chalk.red('vite build error:\n' + error))
|
11
|
-
process.exit(1)
|
12
|
-
}
|
13
|
-
}
|
14
|
-
runBuild()
|
@@ -1,49 +0,0 @@
|
|
1
|
-
import antFuEslint from '@antfu/eslint-config'
|
2
|
-
|
3
|
-
export default antFuEslint({
|
4
|
-
vue: true,
|
5
|
-
vueJsx: false,
|
6
|
-
typescript: true,
|
7
|
-
gitignore: true,
|
8
|
-
markdown: true,
|
9
|
-
ignores: [
|
10
|
-
'src/assets/**/*.js',
|
11
|
-
'build/plugin/viteMock',
|
12
|
-
'public',
|
13
|
-
'tsconfig.*.json',
|
14
|
-
'tsconfig.json'
|
15
|
-
]
|
16
|
-
}, {
|
17
|
-
rules: {
|
18
|
-
'curly': 0,
|
19
|
-
'no-console': 0,
|
20
|
-
'import/order': 0,
|
21
|
-
'style/quote-props': 0,
|
22
|
-
'style/brace-style': 0,
|
23
|
-
'style/comma-dangle': 0,
|
24
|
-
'style/multiline-ternary': 0,
|
25
|
-
'prefer-regex-literals': 0,
|
26
|
-
'antfu/top-level-function': 0,
|
27
|
-
'vue/array-bracket-spacing': 0,
|
28
|
-
'style/array-bracket-spacing': 0,
|
29
|
-
'node/prefer-global/process': 0,
|
30
|
-
'style/indent': 0,
|
31
|
-
'prefer-template': 0,
|
32
|
-
'dot-notation': 0,
|
33
|
-
'no-cond-assign': 0,
|
34
|
-
'no-useless-computed-key': 0,
|
35
|
-
'node/no-deprecated-api': 0,
|
36
|
-
'antfu/consistent-list-newline': 0,
|
37
|
-
'import/no-mutable-exports': 0,
|
38
|
-
'style/member-delimiter-style': 0,
|
39
|
-
'unused-imports/no-unused-imports': 0,
|
40
|
-
'eslint-comments/no-unlimited-disable': 0,
|
41
|
-
'no-async-promise-executor': 0,
|
42
|
-
'unicorn/escape-case': 0,
|
43
|
-
'ts/method-signature-style': 0,
|
44
|
-
'style/no-trailing-spaces': 0,
|
45
|
-
'ts/consistent-type-imports': 0,
|
46
|
-
'style/type-generic-spacing': 0,
|
47
|
-
'prefer-promise-reject-errors': 0
|
48
|
-
}
|
49
|
-
})
|
@@ -1,24 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html lang="zh">
|
3
|
-
<head>
|
4
|
-
<meta charset="UTF-8" />
|
5
|
-
<link rel="icon" href="/favicon.ico" type="image/x-icon" />
|
6
|
-
<meta
|
7
|
-
name="viewport"
|
8
|
-
content="width=device-width,viewport-fit=cover,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"
|
9
|
-
/>
|
10
|
-
<title>vue-vant-mobile</title>
|
11
|
-
<% for (var i in injectLink) { %>
|
12
|
-
<link rel="stylesheet" type="text/css" href="<%= injectLink[i] %>" />
|
13
|
-
<% } %>
|
14
|
-
</head>
|
15
|
-
<body>
|
16
|
-
<div id="app"></div>
|
17
|
-
<% for (var i in injectScript) { %>
|
18
|
-
<script type="text/javascript" src="<%= injectScript[i] %>"></script>
|
19
|
-
<% } %>
|
20
|
-
<script type="module" src="/src/main.ts"></script>
|
21
|
-
<%- injectVlogScript %>
|
22
|
-
<script src="/js/flexible.js"></script>
|
23
|
-
</body>
|
24
|
-
</html>
|
@@ -1,19 +0,0 @@
|
|
1
|
-
import { createProdMockServer } from '../build/plugin/viteMock/client'
|
2
|
-
|
3
|
-
const modules = import.meta.glob('./datasSource/**/*.ts', { eager: true })
|
4
|
-
|
5
|
-
const mockModules: any[] = []
|
6
|
-
Object.keys(modules).forEach((key) => {
|
7
|
-
if (key.includes('/_')) {
|
8
|
-
return
|
9
|
-
}
|
10
|
-
if (modules[key] && modules[key]['default'])
|
11
|
-
mockModules.push(...modules[key]['default'])
|
12
|
-
})
|
13
|
-
|
14
|
-
/**
|
15
|
-
* Used in a production environment. Need to manually import all modules
|
16
|
-
*/
|
17
|
-
export function setupProdMockServer() {
|
18
|
-
createProdMockServer(mockModules)
|
19
|
-
}
|
File without changes
|
@@ -1,57 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"name": "gx-mobile-cli",
|
3
|
-
"version": "0.0.0",
|
4
|
-
"type": "module",
|
5
|
-
"scripts": {
|
6
|
-
"dev": "vite",
|
7
|
-
"start:pro": "cross-env VITE_APP_ENV=pro vite",
|
8
|
-
"build": "vite build",
|
9
|
-
"build:pro": "vite build --mode pro",
|
10
|
-
"preview": "vite preview"
|
11
|
-
},
|
12
|
-
"dependencies": {
|
13
|
-
"@gx-design-vue/pro-hooks": "^0.2.0-beta.20",
|
14
|
-
"@gx-design-vue/pro-utils": "^0.2.0-beta.28",
|
15
|
-
"@vueuse/core": "^10.7.2",
|
16
|
-
"@vueuse/shared": "^10.7.2",
|
17
|
-
"axios": "^1.6.7",
|
18
|
-
"crypto-js": "^4.1.1",
|
19
|
-
"dayjs": "^1.11.6",
|
20
|
-
"lodash-es": "^4.17.21",
|
21
|
-
"pinia": "2.1.7",
|
22
|
-
"qs": "^6.11.0",
|
23
|
-
"vant": "^4.8.8",
|
24
|
-
"unocss": "^0.58.5",
|
25
|
-
"vue": "^3.5.0",
|
26
|
-
"vue-router": "^4.1.6"
|
27
|
-
},
|
28
|
-
"devDependencies": {
|
29
|
-
"@antfu/eslint-config": "^2.9.0",
|
30
|
-
"@types/lodash-es": "^4.17.4",
|
31
|
-
"@types/node": "^20.11.19",
|
32
|
-
"@typescript-eslint/eslint-plugin": "^5.20.0",
|
33
|
-
"@typescript-eslint/parser": "^5.20.0",
|
34
|
-
"@vitejs/plugin-vue": "^5.0.4",
|
35
|
-
"@vitejs/plugin-vue-jsx": "^3.1.0",
|
36
|
-
"autoprefixer": "^10.4.13",
|
37
|
-
"mockjs": "^1.1.0",
|
38
|
-
"cross-env": "^7.0.3",
|
39
|
-
"connect": "^3.7.0",
|
40
|
-
"path-to-regexp": "^6.2.1",
|
41
|
-
"bundle-require": "^4.0.1",
|
42
|
-
"less": "^4.1.3",
|
43
|
-
"less-loader": "^11.1.0",
|
44
|
-
"postcss": "^8.4.18",
|
45
|
-
"postcss-html": "^1.5.0",
|
46
|
-
"postcss-less": "^6.0.0",
|
47
|
-
"postcss-pxtorem": "^6.0.0",
|
48
|
-
"prettier": "^2.7.1",
|
49
|
-
"typescript": "^5.3.3",
|
50
|
-
"unplugin-auto-import": "^0.11.4",
|
51
|
-
"unplugin-vue-components": "^0.22.9",
|
52
|
-
"vite": "^5.1.4",
|
53
|
-
"vite-plugin-html": "^3.2.0",
|
54
|
-
"vite-plugin-vue-setup-extend": "^0.4.0",
|
55
|
-
"vue-tsc": "^1.8.27"
|
56
|
-
}
|
57
|
-
}
|
@@ -1,18 +0,0 @@
|
|
1
|
-
module.exports = {
|
2
|
-
printWidth: 100,
|
3
|
-
useTabs: false,
|
4
|
-
semi: false,
|
5
|
-
singleQuote: true,
|
6
|
-
quoteProps: 'as-needed',
|
7
|
-
bracketSpacing: true,
|
8
|
-
trailingComma: 'none',
|
9
|
-
jsxBracketSameLine: false,
|
10
|
-
jsxSingleQuote: false,
|
11
|
-
arrowParens: 'always',
|
12
|
-
insertPragma: false,
|
13
|
-
requirePragma: false,
|
14
|
-
proseWrap: 'never',
|
15
|
-
htmlWhitespaceSensitivity: 'strict',
|
16
|
-
endOfLine: 'auto',
|
17
|
-
rangeStart: 0,
|
18
|
-
};
|
Binary file
|
@@ -1,44 +0,0 @@
|
|
1
|
-
(function flexible (window, document) {
|
2
|
-
var docEl = document.documentElement
|
3
|
-
var dpr = window.devicePixelRatio || 1
|
4
|
-
|
5
|
-
// adjust body font size
|
6
|
-
function setBodyFontSize () {
|
7
|
-
if (document.body) {
|
8
|
-
document.body.style.fontSize = (12 * dpr) + 'px'
|
9
|
-
}
|
10
|
-
else {
|
11
|
-
document.addEventListener('DOMContentLoaded', setBodyFontSize)
|
12
|
-
}
|
13
|
-
}
|
14
|
-
setBodyFontSize();
|
15
|
-
|
16
|
-
// set 1rem = viewWidth / 10
|
17
|
-
function setRemUnit () {
|
18
|
-
var rem = (docEl.clientWidth < 600 ? docEl.clientWidth : 600) / 10
|
19
|
-
docEl.style.fontSize = rem + 'px'
|
20
|
-
}
|
21
|
-
|
22
|
-
setRemUnit()
|
23
|
-
|
24
|
-
// reset rem unit on page resize
|
25
|
-
window.addEventListener('resize', setRemUnit)
|
26
|
-
window.addEventListener('pageshow', function (e) {
|
27
|
-
if (e.persisted) {
|
28
|
-
setRemUnit()
|
29
|
-
}
|
30
|
-
})
|
31
|
-
|
32
|
-
// detect 0.5px supports
|
33
|
-
if (dpr >= 2) {
|
34
|
-
var fakeBody = document.createElement('body')
|
35
|
-
var testElement = document.createElement('div')
|
36
|
-
testElement.style.border = '.5px solid transparent'
|
37
|
-
fakeBody.appendChild(testElement)
|
38
|
-
docEl.appendChild(fakeBody)
|
39
|
-
if (testElement.offsetHeight === 1) {
|
40
|
-
docEl.classList.add('hairlines')
|
41
|
-
}
|
42
|
-
docEl.removeChild(fakeBody)
|
43
|
-
}
|
44
|
-
}(window, document))
|
@@ -1,29 +0,0 @@
|
|
1
|
-
import type { FunctionalComponent } from 'vue'
|
2
|
-
import { Skeleton } from 'vant'
|
3
|
-
import styles from './style.module.less'
|
4
|
-
|
5
|
-
import 'vant/es/skeleton/style'
|
6
|
-
|
7
|
-
const Proskeleton: FunctionalComponent<{ line: number; loading: boolean }> = (props, { slots }) => {
|
8
|
-
const renderMapItem = () => {
|
9
|
-
const show = []
|
10
|
-
for (let i = 0; i < props.line; i += 1) {
|
11
|
-
show.push(
|
12
|
-
<div class={styles.skeletonItem}>
|
13
|
-
<Skeleton row={3} loading />
|
14
|
-
</div>
|
15
|
-
)
|
16
|
-
}
|
17
|
-
return show
|
18
|
-
}
|
19
|
-
|
20
|
-
return (
|
21
|
-
<>
|
22
|
-
{
|
23
|
-
props.loading ? renderMapItem() : <>{ slots.default?.() }</>
|
24
|
-
}
|
25
|
-
</>
|
26
|
-
)
|
27
|
-
}
|
28
|
-
|
29
|
-
export default Proskeleton
|
@@ -1,115 +0,0 @@
|
|
1
|
-
import { defineComponent, toRefs, watch } from 'vue'
|
2
|
-
import { usePageLoading } from '@gx-mobile/hooks/web'
|
3
|
-
import ProSkeleton from './ProSkeleton'
|
4
|
-
import styles from './style.module.less'
|
5
|
-
import type { SetLoadingParams } from '@gx-mobile/hooks/web/usePageLoading'
|
6
|
-
|
7
|
-
export type PageLoadingTpe = 'toast' | 'skeleton'
|
8
|
-
|
9
|
-
type ChangeLoadingParams<T> = Omit<SetLoadingParams<T>, 'type'> & {
|
10
|
-
hiddenSlot?: boolean;
|
11
|
-
}
|
12
|
-
|
13
|
-
const PageContainer = defineComponent({
|
14
|
-
name: 'GProPageContainer',
|
15
|
-
inheritAttrs: false,
|
16
|
-
props: {
|
17
|
-
loading: Boolean as VuePropType<boolean>,
|
18
|
-
hiddenSlot: {
|
19
|
-
type: Boolean as VuePropType<boolean>,
|
20
|
-
default: true
|
21
|
-
},
|
22
|
-
loadingMsg: {
|
23
|
-
type: String as VuePropType<string>,
|
24
|
-
default: '加载中'
|
25
|
-
},
|
26
|
-
loadingType: {
|
27
|
-
type: String as VuePropType<PageLoadingTpe>,
|
28
|
-
default: 'toast'
|
29
|
-
},
|
30
|
-
bgcolor: {
|
31
|
-
type: String as VuePropType<string>,
|
32
|
-
default: '#fafafa'
|
33
|
-
}
|
34
|
-
},
|
35
|
-
emits: [ 'update:loading' ],
|
36
|
-
setup(props, { slots, expose, emit }) {
|
37
|
-
const { loading: loadingRef, loadingType, loadingMsg, hiddenSlot } = toRefs(props)
|
38
|
-
|
39
|
-
const initStatus = ref(true)
|
40
|
-
|
41
|
-
const hiddenSlotRef = ref(props.hiddenSlot)
|
42
|
-
|
43
|
-
const [ loading, setLoading ] = usePageLoading({
|
44
|
-
defaultType: loadingType.value,
|
45
|
-
defaultMessage: loadingMsg.value,
|
46
|
-
defaultLoading: loadingRef.value
|
47
|
-
})
|
48
|
-
|
49
|
-
watch(() => loading.value, (val) => {
|
50
|
-
if (initStatus.value && val)
|
51
|
-
initStatus.value = false
|
52
|
-
emit('update:loading', val)
|
53
|
-
}, {
|
54
|
-
deep: true,
|
55
|
-
immediate: true
|
56
|
-
})
|
57
|
-
|
58
|
-
watch(() => loadingRef.value, (val) => {
|
59
|
-
if (loadingType.value === 'toast') {
|
60
|
-
setLoading({
|
61
|
-
value: val,
|
62
|
-
type: loadingType.value,
|
63
|
-
message: loadingMsg.value
|
64
|
-
})
|
65
|
-
} else if (initStatus.value || !val) {
|
66
|
-
setLoading({
|
67
|
-
value: val,
|
68
|
-
type: loadingType.value,
|
69
|
-
message: loadingMsg.value
|
70
|
-
})
|
71
|
-
}
|
72
|
-
})
|
73
|
-
|
74
|
-
watch(() => hiddenSlot.value, (val) => {
|
75
|
-
hiddenSlotRef.value = val
|
76
|
-
}, {
|
77
|
-
immediate: true
|
78
|
-
})
|
79
|
-
|
80
|
-
const changeLoading = ({
|
81
|
-
value,
|
82
|
-
message,
|
83
|
-
hiddenSlot
|
84
|
-
}: ChangeLoadingParams<boolean>) => {
|
85
|
-
if (loadingType.value === 'toast') {
|
86
|
-
hiddenSlotRef.value = hiddenSlot
|
87
|
-
setLoading({ value, message, type: loadingType.value })
|
88
|
-
}
|
89
|
-
}
|
90
|
-
|
91
|
-
expose({
|
92
|
-
toggleLoading: changeLoading
|
93
|
-
})
|
94
|
-
|
95
|
-
return () => {
|
96
|
-
return (
|
97
|
-
<div class={styles.pageContainer} style={{ backgroundColor: props.bgcolor }}>
|
98
|
-
<div class={styles.pageContainerWrapper}>
|
99
|
-
{
|
100
|
-
loadingType.value === 'skeleton'
|
101
|
-
? (
|
102
|
-
<ProSkeleton line={3} loading={loading.value}>
|
103
|
-
{slots.default?.()}
|
104
|
-
</ProSkeleton>
|
105
|
-
)
|
106
|
-
: ((!loading.value || !hiddenSlotRef.value) && <>{slots.default?.()}</>)
|
107
|
-
}
|
108
|
-
</div>
|
109
|
-
</div>
|
110
|
-
)
|
111
|
-
}
|
112
|
-
}
|
113
|
-
})
|
114
|
-
|
115
|
-
export default PageContainer
|
File without changes
|
@@ -1,155 +0,0 @@
|
|
1
|
-
/****reset****/
|
2
|
-
body,
|
3
|
-
div,
|
4
|
-
table,
|
5
|
-
tr,
|
6
|
-
td,
|
7
|
-
th,
|
8
|
-
h1,
|
9
|
-
h2,
|
10
|
-
h3,
|
11
|
-
h4,
|
12
|
-
h5,
|
13
|
-
h6,
|
14
|
-
form,
|
15
|
-
input,
|
16
|
-
button,
|
17
|
-
label,
|
18
|
-
select,
|
19
|
-
textarea,
|
20
|
-
p,
|
21
|
-
u,
|
22
|
-
i,
|
23
|
-
em,
|
24
|
-
ul,
|
25
|
-
ol,
|
26
|
-
li,
|
27
|
-
dl,
|
28
|
-
dd,
|
29
|
-
dt,
|
30
|
-
img,
|
31
|
-
article,
|
32
|
-
aside,
|
33
|
-
details,
|
34
|
-
figcaption,
|
35
|
-
figure,
|
36
|
-
footer,
|
37
|
-
header,
|
38
|
-
menu,
|
39
|
-
nav,
|
40
|
-
section,
|
41
|
-
pre {
|
42
|
-
box-sizing: border-box;
|
43
|
-
margin: 0;
|
44
|
-
padding: 0;
|
45
|
-
font-size: 100%;
|
46
|
-
vertical-align: baseline;
|
47
|
-
border: 0;
|
48
|
-
outline: 0;
|
49
|
-
}
|
50
|
-
|
51
|
-
li {
|
52
|
-
list-style: none;
|
53
|
-
}
|
54
|
-
|
55
|
-
h1,
|
56
|
-
h2,
|
57
|
-
h3,
|
58
|
-
h4,
|
59
|
-
h5,
|
60
|
-
h6 {
|
61
|
-
font-size: 100%;
|
62
|
-
}
|
63
|
-
|
64
|
-
table {
|
65
|
-
border-collapse: collapse;
|
66
|
-
border-spacing: 0;
|
67
|
-
width: 100%;
|
68
|
-
}
|
69
|
-
|
70
|
-
a,
|
71
|
-
input,
|
72
|
-
select,
|
73
|
-
textarea,
|
74
|
-
area,
|
75
|
-
button {
|
76
|
-
outline: none;
|
77
|
-
font-family: inherit;
|
78
|
-
font-size: inherit;
|
79
|
-
border: none;
|
80
|
-
background: none;
|
81
|
-
color: inherit;
|
82
|
-
}
|
83
|
-
|
84
|
-
a {
|
85
|
-
text-decoration: none;
|
86
|
-
}
|
87
|
-
|
88
|
-
a:hover {
|
89
|
-
text-decoration: none;
|
90
|
-
}
|
91
|
-
|
92
|
-
textarea {
|
93
|
-
overflow: auto;
|
94
|
-
resize: none;
|
95
|
-
}
|
96
|
-
|
97
|
-
input[type='button'],
|
98
|
-
input[type='submit'],
|
99
|
-
input[type='reset'] {
|
100
|
-
cursor: pointer;
|
101
|
-
-webkit-appearance: none;
|
102
|
-
}
|
103
|
-
|
104
|
-
html,
|
105
|
-
body {
|
106
|
-
overflow-x: hidden;
|
107
|
-
width: 100%;
|
108
|
-
height: 100%;
|
109
|
-
background: #ffffff;
|
110
|
-
}
|
111
|
-
|
112
|
-
* {
|
113
|
-
-webkit-overflow-scrolling: touch;
|
114
|
-
}
|
115
|
-
|
116
|
-
html {
|
117
|
-
-webkit-tap-highlight-color: transparent;
|
118
|
-
}
|
119
|
-
|
120
|
-
body {
|
121
|
-
text-align: left;
|
122
|
-
padding-bottom: constant(safe-area-inset-bottom);
|
123
|
-
padding-bottom: env(safe-area-inset-bottom);
|
124
|
-
|
125
|
-
#app {
|
126
|
-
height: 100%;
|
127
|
-
-webkit-font-smoothing: antialiased;
|
128
|
-
-moz-osx-font-smoothing: grayscale;
|
129
|
-
overflow-x: hidden;
|
130
|
-
box-sizing: border-box;
|
131
|
-
}
|
132
|
-
}
|
133
|
-
|
134
|
-
.fl {
|
135
|
-
float: left;
|
136
|
-
}
|
137
|
-
|
138
|
-
.fr {
|
139
|
-
float: right;
|
140
|
-
}
|
141
|
-
|
142
|
-
.clearfix {
|
143
|
-
zoom: 1;
|
144
|
-
&::before,
|
145
|
-
&::after {
|
146
|
-
display: table;
|
147
|
-
content: ' ';
|
148
|
-
}
|
149
|
-
&::after {
|
150
|
-
clear: both;
|
151
|
-
height: 0;
|
152
|
-
font-size: 0;
|
153
|
-
visibility: hidden;
|
154
|
-
}
|
155
|
-
}
|
@@ -1 +0,0 @@
|
|
1
|
-
@import './design/index';
|