Merge branch 'master' of http://154.8.193.216:3030/admin1/jiangchengfeiyi-xiaochengxu
This commit is contained in:
commit
6382845f8b
3
.idea/.gitignore
vendored
3
.idea/.gitignore
vendored
|
@ -3,6 +3,3 @@
|
||||||
/workspace.xml
|
/workspace.xml
|
||||||
# 基于编辑器的 HTTP 客户端请求
|
# 基于编辑器的 HTTP 客户端请求
|
||||||
/httpRequests/
|
/httpRequests/
|
||||||
# Datasource local storage ignored files
|
|
||||||
/dataSources/
|
|
||||||
/dataSources.local.xml
|
|
||||||
|
|
12
.idea/jiangchengfeiyi-xiaochengxu.iml
Normal file
12
.idea/jiangchengfeiyi-xiaochengxu.iml
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module type="WEB_MODULE" version="4">
|
||||||
|
<component name="NewModuleRootManager">
|
||||||
|
<content url="file://$MODULE_DIR$">
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/temp" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/tmp" />
|
||||||
|
</content>
|
||||||
|
<orderEntry type="inheritedJdk" />
|
||||||
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
</component>
|
||||||
|
</module>
|
|
@ -2,7 +2,7 @@
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="ProjectModuleManager">
|
<component name="ProjectModuleManager">
|
||||||
<modules>
|
<modules>
|
||||||
<module fileurl="file://$PROJECT_DIR$/.idea/FeiYi.iml" filepath="$PROJECT_DIR$/.idea/FeiYi.iml" />
|
<module fileurl="file://$PROJECT_DIR$/.idea/jiangchengfeiyi-xiaochengxu.iml" filepath="$PROJECT_DIR$/.idea/jiangchengfeiyi-xiaochengxu.iml" />
|
||||||
</modules>
|
</modules>
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
15
node_modules/.bin/vue-demi-fix
generated
vendored
15
node_modules/.bin/vue-demi-fix
generated
vendored
|
@ -1,15 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
||||||
|
|
||||||
case `uname` in
|
|
||||||
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if [ -x "$basedir/node" ]; then
|
|
||||||
"$basedir/node" "$basedir/../vue-demi/bin/vue-demi-fix.js" "$@"
|
|
||||||
ret=$?
|
|
||||||
else
|
|
||||||
node "$basedir/../vue-demi/bin/vue-demi-fix.js" "$@"
|
|
||||||
ret=$?
|
|
||||||
fi
|
|
||||||
exit $ret
|
|
17
node_modules/.bin/vue-demi-fix.cmd
generated
vendored
17
node_modules/.bin/vue-demi-fix.cmd
generated
vendored
|
@ -1,17 +0,0 @@
|
||||||
@ECHO off
|
|
||||||
SETLOCAL
|
|
||||||
CALL :find_dp0
|
|
||||||
|
|
||||||
IF EXIST "%dp0%\node.exe" (
|
|
||||||
SET "_prog=%dp0%\node.exe"
|
|
||||||
) ELSE (
|
|
||||||
SET "_prog=node"
|
|
||||||
SET PATHEXT=%PATHEXT:;.JS;=;%
|
|
||||||
)
|
|
||||||
|
|
||||||
"%_prog%" "%dp0%\..\vue-demi\bin\vue-demi-fix.js" %*
|
|
||||||
ENDLOCAL
|
|
||||||
EXIT /b %errorlevel%
|
|
||||||
:find_dp0
|
|
||||||
SET dp0=%~dp0
|
|
||||||
EXIT /b
|
|
18
node_modules/.bin/vue-demi-fix.ps1
generated
vendored
18
node_modules/.bin/vue-demi-fix.ps1
generated
vendored
|
@ -1,18 +0,0 @@
|
||||||
#!/usr/bin/env pwsh
|
|
||||||
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
|
||||||
|
|
||||||
$exe=""
|
|
||||||
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
|
||||||
# Fix case when both the Windows and Linux builds of Node
|
|
||||||
# are installed in the same directory
|
|
||||||
$exe=".exe"
|
|
||||||
}
|
|
||||||
$ret=0
|
|
||||||
if (Test-Path "$basedir/node$exe") {
|
|
||||||
& "$basedir/node$exe" "$basedir/../vue-demi/bin/vue-demi-fix.js" $args
|
|
||||||
$ret=$LASTEXITCODE
|
|
||||||
} else {
|
|
||||||
& "node$exe" "$basedir/../vue-demi/bin/vue-demi-fix.js" $args
|
|
||||||
$ret=$LASTEXITCODE
|
|
||||||
}
|
|
||||||
exit $ret
|
|
15
node_modules/.bin/vue-demi-switch
generated
vendored
15
node_modules/.bin/vue-demi-switch
generated
vendored
|
@ -1,15 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
||||||
|
|
||||||
case `uname` in
|
|
||||||
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if [ -x "$basedir/node" ]; then
|
|
||||||
"$basedir/node" "$basedir/../vue-demi/bin/vue-demi-switch.js" "$@"
|
|
||||||
ret=$?
|
|
||||||
else
|
|
||||||
node "$basedir/../vue-demi/bin/vue-demi-switch.js" "$@"
|
|
||||||
ret=$?
|
|
||||||
fi
|
|
||||||
exit $ret
|
|
17
node_modules/.bin/vue-demi-switch.cmd
generated
vendored
17
node_modules/.bin/vue-demi-switch.cmd
generated
vendored
|
@ -1,17 +0,0 @@
|
||||||
@ECHO off
|
|
||||||
SETLOCAL
|
|
||||||
CALL :find_dp0
|
|
||||||
|
|
||||||
IF EXIST "%dp0%\node.exe" (
|
|
||||||
SET "_prog=%dp0%\node.exe"
|
|
||||||
) ELSE (
|
|
||||||
SET "_prog=node"
|
|
||||||
SET PATHEXT=%PATHEXT:;.JS;=;%
|
|
||||||
)
|
|
||||||
|
|
||||||
"%_prog%" "%dp0%\..\vue-demi\bin\vue-demi-switch.js" %*
|
|
||||||
ENDLOCAL
|
|
||||||
EXIT /b %errorlevel%
|
|
||||||
:find_dp0
|
|
||||||
SET dp0=%~dp0
|
|
||||||
EXIT /b
|
|
18
node_modules/.bin/vue-demi-switch.ps1
generated
vendored
18
node_modules/.bin/vue-demi-switch.ps1
generated
vendored
|
@ -1,18 +0,0 @@
|
||||||
#!/usr/bin/env pwsh
|
|
||||||
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
|
||||||
|
|
||||||
$exe=""
|
|
||||||
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
|
||||||
# Fix case when both the Windows and Linux builds of Node
|
|
||||||
# are installed in the same directory
|
|
||||||
$exe=".exe"
|
|
||||||
}
|
|
||||||
$ret=0
|
|
||||||
if (Test-Path "$basedir/node$exe") {
|
|
||||||
& "$basedir/node$exe" "$basedir/../vue-demi/bin/vue-demi-switch.js" $args
|
|
||||||
$ret=$LASTEXITCODE
|
|
||||||
} else {
|
|
||||||
& "node$exe" "$basedir/../vue-demi/bin/vue-demi-switch.js" $args
|
|
||||||
$ret=$LASTEXITCODE
|
|
||||||
}
|
|
||||||
exit $ret
|
|
12
node_modules/.package-lock.json
generated
vendored
Normal file
12
node_modules/.package-lock.json
generated
vendored
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
{
|
||||||
|
"name": "jiangchengfeiyi-xiaochengxu",
|
||||||
|
"lockfileVersion": 3,
|
||||||
|
"requires": true,
|
||||||
|
"packages": {
|
||||||
|
"node_modules/mitt": {
|
||||||
|
"version": "3.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/mitt/-/mitt-3.0.1.tgz",
|
||||||
|
"integrity": "sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw=="
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
2
node_modules/@vue/devtools-api/lib/cjs/api/api.js
generated
vendored
2
node_modules/@vue/devtools-api/lib/cjs/api/api.js
generated
vendored
|
@ -1,2 +0,0 @@
|
||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
node_modules/@vue/devtools-api/lib/cjs/api/app.js
generated
vendored
2
node_modules/@vue/devtools-api/lib/cjs/api/app.js
generated
vendored
|
@ -1,2 +0,0 @@
|
||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
node_modules/@vue/devtools-api/lib/cjs/api/component.js
generated
vendored
2
node_modules/@vue/devtools-api/lib/cjs/api/component.js
generated
vendored
|
@ -1,2 +0,0 @@
|
||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
node_modules/@vue/devtools-api/lib/cjs/api/context.js
generated
vendored
2
node_modules/@vue/devtools-api/lib/cjs/api/context.js
generated
vendored
|
@ -1,2 +0,0 @@
|
||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
node_modules/@vue/devtools-api/lib/cjs/api/hooks.js
generated
vendored
2
node_modules/@vue/devtools-api/lib/cjs/api/hooks.js
generated
vendored
|
@ -1,2 +0,0 @@
|
||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
node_modules/@vue/devtools-api/lib/cjs/api/index.js
generated
vendored
22
node_modules/@vue/devtools-api/lib/cjs/api/index.js
generated
vendored
|
@ -1,22 +0,0 @@
|
||||||
"use strict";
|
|
||||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
||||||
if (k2 === undefined) k2 = k;
|
|
||||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
||||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
||||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
||||||
}
|
|
||||||
Object.defineProperty(o, k2, desc);
|
|
||||||
}) : (function(o, m, k, k2) {
|
|
||||||
if (k2 === undefined) k2 = k;
|
|
||||||
o[k2] = m[k];
|
|
||||||
}));
|
|
||||||
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
||||||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
||||||
};
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
__exportStar(require("./api.js"), exports);
|
|
||||||
__exportStar(require("./app.js"), exports);
|
|
||||||
__exportStar(require("./component.js"), exports);
|
|
||||||
__exportStar(require("./context.js"), exports);
|
|
||||||
__exportStar(require("./hooks.js"), exports);
|
|
||||||
__exportStar(require("./util.js"), exports);
|
|
2
node_modules/@vue/devtools-api/lib/cjs/api/util.js
generated
vendored
2
node_modules/@vue/devtools-api/lib/cjs/api/util.js
generated
vendored
|
@ -1,2 +0,0 @@
|
||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
node_modules/@vue/devtools-api/lib/cjs/const.js
generated
vendored
5
node_modules/@vue/devtools-api/lib/cjs/const.js
generated
vendored
|
@ -1,5 +0,0 @@
|
||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
exports.HOOK_PLUGIN_SETTINGS_SET = exports.HOOK_SETUP = void 0;
|
|
||||||
exports.HOOK_SETUP = 'devtools-plugin:setup';
|
|
||||||
exports.HOOK_PLUGIN_SETTINGS_SET = 'plugin:settings:set';
|
|
17
node_modules/@vue/devtools-api/lib/cjs/env.js
generated
vendored
17
node_modules/@vue/devtools-api/lib/cjs/env.js
generated
vendored
|
@ -1,17 +0,0 @@
|
||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
exports.isProxyAvailable = exports.getTarget = exports.getDevtoolsGlobalHook = void 0;
|
|
||||||
function getDevtoolsGlobalHook() {
|
|
||||||
return getTarget().__VUE_DEVTOOLS_GLOBAL_HOOK__;
|
|
||||||
}
|
|
||||||
exports.getDevtoolsGlobalHook = getDevtoolsGlobalHook;
|
|
||||||
function getTarget() {
|
|
||||||
// @ts-expect-error navigator and windows are not available in all environments
|
|
||||||
return (typeof navigator !== 'undefined' && typeof window !== 'undefined')
|
|
||||||
? window
|
|
||||||
: typeof globalThis !== 'undefined'
|
|
||||||
? globalThis
|
|
||||||
: {};
|
|
||||||
}
|
|
||||||
exports.getTarget = getTarget;
|
|
||||||
exports.isProxyAvailable = typeof Proxy === 'function';
|
|
45
node_modules/@vue/devtools-api/lib/cjs/index.js
generated
vendored
45
node_modules/@vue/devtools-api/lib/cjs/index.js
generated
vendored
|
@ -1,45 +0,0 @@
|
||||||
"use strict";
|
|
||||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
||||||
if (k2 === undefined) k2 = k;
|
|
||||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
||||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
||||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
||||||
}
|
|
||||||
Object.defineProperty(o, k2, desc);
|
|
||||||
}) : (function(o, m, k, k2) {
|
|
||||||
if (k2 === undefined) k2 = k;
|
|
||||||
o[k2] = m[k];
|
|
||||||
}));
|
|
||||||
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
||||||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
||||||
};
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
exports.setupDevtoolsPlugin = void 0;
|
|
||||||
const env_js_1 = require("./env.js");
|
|
||||||
const const_js_1 = require("./const.js");
|
|
||||||
const proxy_js_1 = require("./proxy.js");
|
|
||||||
__exportStar(require("./api/index.js"), exports);
|
|
||||||
__exportStar(require("./plugin.js"), exports);
|
|
||||||
__exportStar(require("./time.js"), exports);
|
|
||||||
function setupDevtoolsPlugin(pluginDescriptor, setupFn) {
|
|
||||||
const descriptor = pluginDescriptor;
|
|
||||||
const target = (0, env_js_1.getTarget)();
|
|
||||||
const hook = (0, env_js_1.getDevtoolsGlobalHook)();
|
|
||||||
const enableProxy = env_js_1.isProxyAvailable && descriptor.enableEarlyProxy;
|
|
||||||
if (hook && (target.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__ || !enableProxy)) {
|
|
||||||
hook.emit(const_js_1.HOOK_SETUP, pluginDescriptor, setupFn);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
const proxy = enableProxy ? new proxy_js_1.ApiProxy(descriptor, hook) : null;
|
|
||||||
const list = target.__VUE_DEVTOOLS_PLUGINS__ = target.__VUE_DEVTOOLS_PLUGINS__ || [];
|
|
||||||
list.push({
|
|
||||||
pluginDescriptor: descriptor,
|
|
||||||
setupFn,
|
|
||||||
proxy,
|
|
||||||
});
|
|
||||||
if (proxy) {
|
|
||||||
setupFn(proxy.proxiedTarget);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
exports.setupDevtoolsPlugin = setupDevtoolsPlugin;
|
|
2
node_modules/@vue/devtools-api/lib/cjs/plugin.js
generated
vendored
2
node_modules/@vue/devtools-api/lib/cjs/plugin.js
generated
vendored
|
@ -1,2 +0,0 @@
|
||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
111
node_modules/@vue/devtools-api/lib/cjs/proxy.js
generated
vendored
111
node_modules/@vue/devtools-api/lib/cjs/proxy.js
generated
vendored
|
@ -1,111 +0,0 @@
|
||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
exports.ApiProxy = void 0;
|
|
||||||
const const_js_1 = require("./const.js");
|
|
||||||
const time_js_1 = require("./time.js");
|
|
||||||
class ApiProxy {
|
|
||||||
constructor(plugin, hook) {
|
|
||||||
this.target = null;
|
|
||||||
this.targetQueue = [];
|
|
||||||
this.onQueue = [];
|
|
||||||
this.plugin = plugin;
|
|
||||||
this.hook = hook;
|
|
||||||
const defaultSettings = {};
|
|
||||||
if (plugin.settings) {
|
|
||||||
for (const id in plugin.settings) {
|
|
||||||
const item = plugin.settings[id];
|
|
||||||
defaultSettings[id] = item.defaultValue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const localSettingsSaveId = `__vue-devtools-plugin-settings__${plugin.id}`;
|
|
||||||
let currentSettings = Object.assign({}, defaultSettings);
|
|
||||||
try {
|
|
||||||
const raw = localStorage.getItem(localSettingsSaveId);
|
|
||||||
const data = JSON.parse(raw);
|
|
||||||
Object.assign(currentSettings, data);
|
|
||||||
}
|
|
||||||
catch (e) {
|
|
||||||
// noop
|
|
||||||
}
|
|
||||||
this.fallbacks = {
|
|
||||||
getSettings() {
|
|
||||||
return currentSettings;
|
|
||||||
},
|
|
||||||
setSettings(value) {
|
|
||||||
try {
|
|
||||||
localStorage.setItem(localSettingsSaveId, JSON.stringify(value));
|
|
||||||
}
|
|
||||||
catch (e) {
|
|
||||||
// noop
|
|
||||||
}
|
|
||||||
currentSettings = value;
|
|
||||||
},
|
|
||||||
now() {
|
|
||||||
return (0, time_js_1.now)();
|
|
||||||
},
|
|
||||||
};
|
|
||||||
if (hook) {
|
|
||||||
hook.on(const_js_1.HOOK_PLUGIN_SETTINGS_SET, (pluginId, value) => {
|
|
||||||
if (pluginId === this.plugin.id) {
|
|
||||||
this.fallbacks.setSettings(value);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
this.proxiedOn = new Proxy({}, {
|
|
||||||
get: (_target, prop) => {
|
|
||||||
if (this.target) {
|
|
||||||
return this.target.on[prop];
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return (...args) => {
|
|
||||||
this.onQueue.push({
|
|
||||||
method: prop,
|
|
||||||
args,
|
|
||||||
});
|
|
||||||
};
|
|
||||||
}
|
|
||||||
},
|
|
||||||
});
|
|
||||||
this.proxiedTarget = new Proxy({}, {
|
|
||||||
get: (_target, prop) => {
|
|
||||||
if (this.target) {
|
|
||||||
return this.target[prop];
|
|
||||||
}
|
|
||||||
else if (prop === 'on') {
|
|
||||||
return this.proxiedOn;
|
|
||||||
}
|
|
||||||
else if (Object.keys(this.fallbacks).includes(prop)) {
|
|
||||||
return (...args) => {
|
|
||||||
this.targetQueue.push({
|
|
||||||
method: prop,
|
|
||||||
args,
|
|
||||||
resolve: () => { },
|
|
||||||
});
|
|
||||||
return this.fallbacks[prop](...args);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return (...args) => {
|
|
||||||
return new Promise((resolve) => {
|
|
||||||
this.targetQueue.push({
|
|
||||||
method: prop,
|
|
||||||
args,
|
|
||||||
resolve,
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
|
||||||
}
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
async setRealTarget(target) {
|
|
||||||
this.target = target;
|
|
||||||
for (const item of this.onQueue) {
|
|
||||||
this.target.on[item.method](...item.args);
|
|
||||||
}
|
|
||||||
for (const item of this.targetQueue) {
|
|
||||||
item.resolve(await this.target[item.method](...item.args));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
exports.ApiProxy = ApiProxy;
|
|
28
node_modules/@vue/devtools-api/lib/cjs/time.js
generated
vendored
28
node_modules/@vue/devtools-api/lib/cjs/time.js
generated
vendored
|
@ -1,28 +0,0 @@
|
||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
exports.now = exports.isPerformanceSupported = void 0;
|
|
||||||
let supported;
|
|
||||||
let perf;
|
|
||||||
function isPerformanceSupported() {
|
|
||||||
var _a;
|
|
||||||
if (supported !== undefined) {
|
|
||||||
return supported;
|
|
||||||
}
|
|
||||||
if (typeof window !== 'undefined' && window.performance) {
|
|
||||||
supported = true;
|
|
||||||
perf = window.performance;
|
|
||||||
}
|
|
||||||
else if (typeof globalThis !== 'undefined' && ((_a = globalThis.perf_hooks) === null || _a === void 0 ? void 0 : _a.performance)) {
|
|
||||||
supported = true;
|
|
||||||
perf = globalThis.perf_hooks.performance;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
supported = false;
|
|
||||||
}
|
|
||||||
return supported;
|
|
||||||
}
|
|
||||||
exports.isPerformanceSupported = isPerformanceSupported;
|
|
||||||
function now() {
|
|
||||||
return isPerformanceSupported() ? perf.now() : Date.now();
|
|
||||||
}
|
|
||||||
exports.now = now;
|
|
108
node_modules/@vue/devtools-api/lib/esm/api/api.d.ts
generated
vendored
108
node_modules/@vue/devtools-api/lib/esm/api/api.d.ts
generated
vendored
|
@ -1,108 +0,0 @@
|
||||||
import type { ComponentBounds, Hookable } from './hooks.js';
|
|
||||||
import type { Context } from './context.js';
|
|
||||||
import type { ComponentInstance, ComponentState, StateBase } from './component.js';
|
|
||||||
import type { App } from './app.js';
|
|
||||||
import type { ID } from './util.js';
|
|
||||||
export interface DevtoolsPluginApi<TSettings> {
|
|
||||||
on: Hookable<Context>;
|
|
||||||
notifyComponentUpdate: (instance?: ComponentInstance) => void;
|
|
||||||
addTimelineLayer: (options: TimelineLayerOptions) => void;
|
|
||||||
addTimelineEvent: (options: TimelineEventOptions) => void;
|
|
||||||
addInspector: (options: CustomInspectorOptions) => void;
|
|
||||||
sendInspectorTree: (inspectorId: string) => void;
|
|
||||||
sendInspectorState: (inspectorId: string) => void;
|
|
||||||
selectInspectorNode: (inspectorId: string, nodeId: string) => void;
|
|
||||||
getComponentBounds: (instance: ComponentInstance) => Promise<ComponentBounds>;
|
|
||||||
getComponentName: (instance: ComponentInstance) => Promise<string>;
|
|
||||||
getComponentInstances: (app: App) => Promise<ComponentInstance[]>;
|
|
||||||
highlightElement: (instance: ComponentInstance) => void;
|
|
||||||
unhighlightElement: () => void;
|
|
||||||
getSettings: (pluginId?: string) => TSettings;
|
|
||||||
now: () => number;
|
|
||||||
/**
|
|
||||||
* @private
|
|
||||||
*/
|
|
||||||
setSettings: (values: TSettings) => void;
|
|
||||||
}
|
|
||||||
export interface AppRecord {
|
|
||||||
id: string;
|
|
||||||
name: string;
|
|
||||||
instanceMap: Map<string, ComponentInstance>;
|
|
||||||
rootInstance: ComponentInstance;
|
|
||||||
}
|
|
||||||
export interface TimelineLayerOptions<TData = any, TMeta = any> {
|
|
||||||
id: string;
|
|
||||||
label: string;
|
|
||||||
color: number;
|
|
||||||
skipScreenshots?: boolean;
|
|
||||||
groupsOnly?: boolean;
|
|
||||||
ignoreNoDurationGroups?: boolean;
|
|
||||||
screenshotOverlayRender?: (event: TimelineEvent<TData, TMeta> & ScreenshotOverlayEvent, ctx: ScreenshotOverlayRenderContext) => ScreenshotOverlayRenderResult | Promise<ScreenshotOverlayRenderResult>;
|
|
||||||
}
|
|
||||||
export interface ScreenshotOverlayEvent {
|
|
||||||
layerId: string;
|
|
||||||
renderMeta: any;
|
|
||||||
}
|
|
||||||
export interface ScreenshotOverlayRenderContext<TData = any, TMeta = any> {
|
|
||||||
screenshot: ScreenshotData;
|
|
||||||
events: (TimelineEvent<TData, TMeta> & ScreenshotOverlayEvent)[];
|
|
||||||
index: number;
|
|
||||||
}
|
|
||||||
export type ScreenshotOverlayRenderResult = HTMLElement | string | false;
|
|
||||||
export interface ScreenshotData {
|
|
||||||
time: number;
|
|
||||||
}
|
|
||||||
export interface TimelineEventOptions {
|
|
||||||
layerId: string;
|
|
||||||
event: TimelineEvent;
|
|
||||||
all?: boolean;
|
|
||||||
}
|
|
||||||
export interface TimelineEvent<TData = any, TMeta = any> {
|
|
||||||
time: number;
|
|
||||||
data: TData;
|
|
||||||
logType?: 'default' | 'warning' | 'error';
|
|
||||||
meta?: TMeta;
|
|
||||||
groupId?: ID;
|
|
||||||
title?: string;
|
|
||||||
subtitle?: string;
|
|
||||||
}
|
|
||||||
export interface TimelineMarkerOptions {
|
|
||||||
id: string;
|
|
||||||
time: number;
|
|
||||||
color: number;
|
|
||||||
label: string;
|
|
||||||
all?: boolean;
|
|
||||||
}
|
|
||||||
export interface CustomInspectorOptions {
|
|
||||||
id: string;
|
|
||||||
label: string;
|
|
||||||
icon?: string;
|
|
||||||
treeFilterPlaceholder?: string;
|
|
||||||
stateFilterPlaceholder?: string;
|
|
||||||
noSelectionText?: string;
|
|
||||||
actions?: {
|
|
||||||
icon: string;
|
|
||||||
tooltip?: string;
|
|
||||||
action: () => void | Promise<void>;
|
|
||||||
}[];
|
|
||||||
nodeActions?: {
|
|
||||||
icon: string;
|
|
||||||
tooltip?: string;
|
|
||||||
action: (nodeId: string) => void | Promise<void>;
|
|
||||||
}[];
|
|
||||||
}
|
|
||||||
export interface CustomInspectorNode {
|
|
||||||
id: string;
|
|
||||||
label: string;
|
|
||||||
children?: CustomInspectorNode[];
|
|
||||||
tags?: InspectorNodeTag[];
|
|
||||||
}
|
|
||||||
export interface InspectorNodeTag {
|
|
||||||
label: string;
|
|
||||||
textColor: number;
|
|
||||||
backgroundColor: number;
|
|
||||||
tooltip?: string;
|
|
||||||
}
|
|
||||||
export interface CustomInspectorState {
|
|
||||||
[key: string]: (StateBase | Omit<ComponentState, 'type'>)[];
|
|
||||||
}
|
|
1
node_modules/@vue/devtools-api/lib/esm/api/api.js
generated
vendored
1
node_modules/@vue/devtools-api/lib/esm/api/api.js
generated
vendored
|
@ -1 +0,0 @@
|
||||||
export {};
|
|
1
node_modules/@vue/devtools-api/lib/esm/api/app.d.ts
generated
vendored
1
node_modules/@vue/devtools-api/lib/esm/api/app.d.ts
generated
vendored
|
@ -1 +0,0 @@
|
||||||
export type App = any;
|
|
1
node_modules/@vue/devtools-api/lib/esm/api/app.js
generated
vendored
1
node_modules/@vue/devtools-api/lib/esm/api/app.js
generated
vendored
|
@ -1 +0,0 @@
|
||||||
export {};
|
|
78
node_modules/@vue/devtools-api/lib/esm/api/component.d.ts
generated
vendored
78
node_modules/@vue/devtools-api/lib/esm/api/component.d.ts
generated
vendored
|
@ -1,78 +0,0 @@
|
||||||
import type { InspectorNodeTag } from './api.js';
|
|
||||||
import type { ID } from './util.js';
|
|
||||||
export type ComponentInstance = any;
|
|
||||||
export interface ComponentTreeNode {
|
|
||||||
uid: ID;
|
|
||||||
id: string;
|
|
||||||
name: string;
|
|
||||||
renderKey: string | number;
|
|
||||||
inactive: boolean;
|
|
||||||
isFragment: boolean;
|
|
||||||
hasChildren: boolean;
|
|
||||||
children: ComponentTreeNode[];
|
|
||||||
domOrder?: number[];
|
|
||||||
consoleId?: string;
|
|
||||||
isRouterView?: boolean;
|
|
||||||
macthedRouteSegment?: string;
|
|
||||||
tags: InspectorNodeTag[];
|
|
||||||
autoOpen: boolean;
|
|
||||||
meta?: any;
|
|
||||||
}
|
|
||||||
export interface InspectedComponentData {
|
|
||||||
id: string;
|
|
||||||
name: string;
|
|
||||||
file: string;
|
|
||||||
state: ComponentState[];
|
|
||||||
functional?: boolean;
|
|
||||||
}
|
|
||||||
export interface StateBase {
|
|
||||||
key: string;
|
|
||||||
value: any;
|
|
||||||
editable?: boolean;
|
|
||||||
objectType?: 'ref' | 'reactive' | 'computed' | 'other';
|
|
||||||
raw?: string;
|
|
||||||
}
|
|
||||||
export interface ComponentStateBase extends StateBase {
|
|
||||||
type: string;
|
|
||||||
}
|
|
||||||
export interface ComponentPropState extends ComponentStateBase {
|
|
||||||
meta?: {
|
|
||||||
type: string;
|
|
||||||
required: boolean;
|
|
||||||
/** Vue 1 only */
|
|
||||||
mode?: 'default' | 'sync' | 'once';
|
|
||||||
};
|
|
||||||
}
|
|
||||||
export type ComponentBuiltinCustomStateTypes = 'function' | 'map' | 'set' | 'reference' | 'component' | 'component-definition' | 'router' | 'store';
|
|
||||||
export interface ComponentCustomState extends ComponentStateBase {
|
|
||||||
value: CustomState;
|
|
||||||
}
|
|
||||||
export interface CustomState {
|
|
||||||
_custom: {
|
|
||||||
type: ComponentBuiltinCustomStateTypes | string;
|
|
||||||
objectType?: string;
|
|
||||||
display?: string;
|
|
||||||
tooltip?: string;
|
|
||||||
value?: any;
|
|
||||||
abstract?: boolean;
|
|
||||||
file?: string;
|
|
||||||
uid?: number;
|
|
||||||
readOnly?: boolean;
|
|
||||||
/** Configure immediate child fields */
|
|
||||||
fields?: {
|
|
||||||
abstract?: boolean;
|
|
||||||
};
|
|
||||||
id?: any;
|
|
||||||
actions?: {
|
|
||||||
icon: string;
|
|
||||||
tooltip?: string;
|
|
||||||
action: () => void | Promise<void>;
|
|
||||||
}[];
|
|
||||||
/** internal */
|
|
||||||
_reviveId?: number;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
export type ComponentState = ComponentStateBase | ComponentPropState | ComponentCustomState;
|
|
||||||
export interface ComponentDevtoolsOptions {
|
|
||||||
hide?: boolean;
|
|
||||||
}
|
|
1
node_modules/@vue/devtools-api/lib/esm/api/component.js
generated
vendored
1
node_modules/@vue/devtools-api/lib/esm/api/component.js
generated
vendored
|
@ -1 +0,0 @@
|
||||||
export {};
|
|
5
node_modules/@vue/devtools-api/lib/esm/api/context.d.ts
generated
vendored
5
node_modules/@vue/devtools-api/lib/esm/api/context.d.ts
generated
vendored
|
@ -1,5 +0,0 @@
|
||||||
import type { AppRecord } from './api.js';
|
|
||||||
export interface Context {
|
|
||||||
currentTab: string;
|
|
||||||
currentAppRecord: AppRecord;
|
|
||||||
}
|
|
1
node_modules/@vue/devtools-api/lib/esm/api/context.js
generated
vendored
1
node_modules/@vue/devtools-api/lib/esm/api/context.js
generated
vendored
|
@ -1 +0,0 @@
|
||||||
export {};
|
|
180
node_modules/@vue/devtools-api/lib/esm/api/hooks.d.ts
generated
vendored
180
node_modules/@vue/devtools-api/lib/esm/api/hooks.d.ts
generated
vendored
|
@ -1,180 +0,0 @@
|
||||||
import type { ComponentDevtoolsOptions, ComponentInstance, ComponentTreeNode, InspectedComponentData } from './component.js';
|
|
||||||
import type { App } from './app.js';
|
|
||||||
import type { CustomInspectorNode, CustomInspectorState, TimelineEvent } from './api.js';
|
|
||||||
export declare const enum Hooks {
|
|
||||||
TRANSFORM_CALL = "transformCall",
|
|
||||||
GET_APP_RECORD_NAME = "getAppRecordName",
|
|
||||||
GET_APP_ROOT_INSTANCE = "getAppRootInstance",
|
|
||||||
REGISTER_APPLICATION = "registerApplication",
|
|
||||||
WALK_COMPONENT_TREE = "walkComponentTree",
|
|
||||||
VISIT_COMPONENT_TREE = "visitComponentTree",
|
|
||||||
WALK_COMPONENT_PARENTS = "walkComponentParents",
|
|
||||||
INSPECT_COMPONENT = "inspectComponent",
|
|
||||||
GET_COMPONENT_BOUNDS = "getComponentBounds",
|
|
||||||
GET_COMPONENT_NAME = "getComponentName",
|
|
||||||
GET_COMPONENT_INSTANCES = "getComponentInstances",
|
|
||||||
GET_ELEMENT_COMPONENT = "getElementComponent",
|
|
||||||
GET_COMPONENT_ROOT_ELEMENTS = "getComponentRootElements",
|
|
||||||
EDIT_COMPONENT_STATE = "editComponentState",
|
|
||||||
GET_COMPONENT_DEVTOOLS_OPTIONS = "getAppDevtoolsOptions",
|
|
||||||
GET_COMPONENT_RENDER_CODE = "getComponentRenderCode",
|
|
||||||
INSPECT_TIMELINE_EVENT = "inspectTimelineEvent",
|
|
||||||
TIMELINE_CLEARED = "timelineCleared",
|
|
||||||
GET_INSPECTOR_TREE = "getInspectorTree",
|
|
||||||
GET_INSPECTOR_STATE = "getInspectorState",
|
|
||||||
EDIT_INSPECTOR_STATE = "editInspectorState",
|
|
||||||
SET_PLUGIN_SETTINGS = "setPluginSettings"
|
|
||||||
}
|
|
||||||
export interface ComponentBounds {
|
|
||||||
left: number;
|
|
||||||
top: number;
|
|
||||||
width: number;
|
|
||||||
height: number;
|
|
||||||
}
|
|
||||||
export interface HookPayloads {
|
|
||||||
[Hooks.TRANSFORM_CALL]: {
|
|
||||||
callName: string;
|
|
||||||
inArgs: any[];
|
|
||||||
outArgs: any[];
|
|
||||||
};
|
|
||||||
[Hooks.GET_APP_RECORD_NAME]: {
|
|
||||||
app: App;
|
|
||||||
name: string;
|
|
||||||
};
|
|
||||||
[Hooks.GET_APP_ROOT_INSTANCE]: {
|
|
||||||
app: App;
|
|
||||||
root: ComponentInstance;
|
|
||||||
};
|
|
||||||
[Hooks.REGISTER_APPLICATION]: {
|
|
||||||
app: App;
|
|
||||||
};
|
|
||||||
[Hooks.WALK_COMPONENT_TREE]: {
|
|
||||||
componentInstance: ComponentInstance;
|
|
||||||
componentTreeData: ComponentTreeNode[];
|
|
||||||
maxDepth: number;
|
|
||||||
filter: string;
|
|
||||||
recursively: boolean;
|
|
||||||
};
|
|
||||||
[Hooks.VISIT_COMPONENT_TREE]: {
|
|
||||||
app: App;
|
|
||||||
componentInstance: ComponentInstance;
|
|
||||||
treeNode: ComponentTreeNode;
|
|
||||||
filter: string;
|
|
||||||
};
|
|
||||||
[Hooks.WALK_COMPONENT_PARENTS]: {
|
|
||||||
componentInstance: ComponentInstance;
|
|
||||||
parentInstances: ComponentInstance[];
|
|
||||||
};
|
|
||||||
[Hooks.INSPECT_COMPONENT]: {
|
|
||||||
app: App;
|
|
||||||
componentInstance: ComponentInstance;
|
|
||||||
instanceData: InspectedComponentData;
|
|
||||||
};
|
|
||||||
[Hooks.GET_COMPONENT_BOUNDS]: {
|
|
||||||
componentInstance: ComponentInstance;
|
|
||||||
bounds: ComponentBounds;
|
|
||||||
};
|
|
||||||
[Hooks.GET_COMPONENT_NAME]: {
|
|
||||||
componentInstance: ComponentInstance;
|
|
||||||
name: string;
|
|
||||||
};
|
|
||||||
[Hooks.GET_COMPONENT_INSTANCES]: {
|
|
||||||
app: App;
|
|
||||||
componentInstances: ComponentInstance[];
|
|
||||||
};
|
|
||||||
[Hooks.GET_ELEMENT_COMPONENT]: {
|
|
||||||
element: HTMLElement | any;
|
|
||||||
componentInstance: ComponentInstance;
|
|
||||||
};
|
|
||||||
[Hooks.GET_COMPONENT_ROOT_ELEMENTS]: {
|
|
||||||
componentInstance: ComponentInstance;
|
|
||||||
rootElements: (HTMLElement | any)[];
|
|
||||||
};
|
|
||||||
[Hooks.EDIT_COMPONENT_STATE]: {
|
|
||||||
app: App;
|
|
||||||
componentInstance: ComponentInstance;
|
|
||||||
path: string[];
|
|
||||||
type: string;
|
|
||||||
state: EditStatePayload;
|
|
||||||
set: (object: any, path?: string | (string[]), value?: any, cb?: (object: any, field: string, value: any) => void) => void;
|
|
||||||
};
|
|
||||||
[Hooks.GET_COMPONENT_DEVTOOLS_OPTIONS]: {
|
|
||||||
componentInstance: ComponentInstance;
|
|
||||||
options: ComponentDevtoolsOptions;
|
|
||||||
};
|
|
||||||
[Hooks.GET_COMPONENT_RENDER_CODE]: {
|
|
||||||
componentInstance: ComponentInstance;
|
|
||||||
code: string;
|
|
||||||
};
|
|
||||||
[Hooks.INSPECT_TIMELINE_EVENT]: {
|
|
||||||
app: App;
|
|
||||||
layerId: string;
|
|
||||||
event: TimelineEvent;
|
|
||||||
all?: boolean;
|
|
||||||
data: any;
|
|
||||||
};
|
|
||||||
[Hooks.TIMELINE_CLEARED]: Record<string, never>;
|
|
||||||
[Hooks.GET_INSPECTOR_TREE]: {
|
|
||||||
app: App;
|
|
||||||
inspectorId: string;
|
|
||||||
filter: string;
|
|
||||||
rootNodes: CustomInspectorNode[];
|
|
||||||
};
|
|
||||||
[Hooks.GET_INSPECTOR_STATE]: {
|
|
||||||
app: App;
|
|
||||||
inspectorId: string;
|
|
||||||
nodeId: string;
|
|
||||||
state: CustomInspectorState;
|
|
||||||
};
|
|
||||||
[Hooks.EDIT_INSPECTOR_STATE]: {
|
|
||||||
app: App;
|
|
||||||
inspectorId: string;
|
|
||||||
nodeId: string;
|
|
||||||
path: string[];
|
|
||||||
type: string;
|
|
||||||
state: EditStatePayload;
|
|
||||||
set: (object: any, path?: string | (string[]), value?: any, cb?: (object: any, field: string, value: any) => void) => void;
|
|
||||||
};
|
|
||||||
[Hooks.SET_PLUGIN_SETTINGS]: {
|
|
||||||
app: App;
|
|
||||||
pluginId: string;
|
|
||||||
key: string;
|
|
||||||
newValue: any;
|
|
||||||
oldValue: any;
|
|
||||||
settings: any;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
export type EditStatePayload = {
|
|
||||||
value: any;
|
|
||||||
newKey?: string | null;
|
|
||||||
remove?: undefined | false;
|
|
||||||
} | {
|
|
||||||
value?: undefined;
|
|
||||||
newKey?: undefined;
|
|
||||||
remove: true;
|
|
||||||
};
|
|
||||||
export type HookHandler<TPayload, TContext> = (payload: TPayload, ctx: TContext) => void | Promise<void>;
|
|
||||||
export interface Hookable<TContext> {
|
|
||||||
transformCall: (handler: HookHandler<HookPayloads[Hooks.TRANSFORM_CALL], TContext>) => any;
|
|
||||||
getAppRecordName: (handler: HookHandler<HookPayloads[Hooks.GET_APP_RECORD_NAME], TContext>) => any;
|
|
||||||
getAppRootInstance: (handler: HookHandler<HookPayloads[Hooks.GET_APP_ROOT_INSTANCE], TContext>) => any;
|
|
||||||
registerApplication: (handler: HookHandler<HookPayloads[Hooks.REGISTER_APPLICATION], TContext>) => any;
|
|
||||||
walkComponentTree: (handler: HookHandler<HookPayloads[Hooks.WALK_COMPONENT_TREE], TContext>) => any;
|
|
||||||
visitComponentTree: (handler: HookHandler<HookPayloads[Hooks.VISIT_COMPONENT_TREE], TContext>) => any;
|
|
||||||
walkComponentParents: (handler: HookHandler<HookPayloads[Hooks.WALK_COMPONENT_PARENTS], TContext>) => any;
|
|
||||||
inspectComponent: (handler: HookHandler<HookPayloads[Hooks.INSPECT_COMPONENT], TContext>) => any;
|
|
||||||
getComponentBounds: (handler: HookHandler<HookPayloads[Hooks.GET_COMPONENT_BOUNDS], TContext>) => any;
|
|
||||||
getComponentName: (handler: HookHandler<HookPayloads[Hooks.GET_COMPONENT_NAME], TContext>) => any;
|
|
||||||
getComponentInstances: (handler: HookHandler<HookPayloads[Hooks.GET_COMPONENT_INSTANCES], TContext>) => any;
|
|
||||||
getElementComponent: (handler: HookHandler<HookPayloads[Hooks.GET_ELEMENT_COMPONENT], TContext>) => any;
|
|
||||||
getComponentRootElements: (handler: HookHandler<HookPayloads[Hooks.GET_COMPONENT_ROOT_ELEMENTS], TContext>) => any;
|
|
||||||
editComponentState: (handler: HookHandler<HookPayloads[Hooks.EDIT_COMPONENT_STATE], TContext>) => any;
|
|
||||||
getComponentDevtoolsOptions: (handler: HookHandler<HookPayloads[Hooks.GET_COMPONENT_DEVTOOLS_OPTIONS], TContext>) => any;
|
|
||||||
getComponentRenderCode: (handler: HookHandler<HookPayloads[Hooks.GET_COMPONENT_RENDER_CODE], TContext>) => any;
|
|
||||||
inspectTimelineEvent: (handler: HookHandler<HookPayloads[Hooks.INSPECT_TIMELINE_EVENT], TContext>) => any;
|
|
||||||
timelineCleared: (handler: HookHandler<HookPayloads[Hooks.TIMELINE_CLEARED], TContext>) => any;
|
|
||||||
getInspectorTree: (handler: HookHandler<HookPayloads[Hooks.GET_INSPECTOR_TREE], TContext>) => any;
|
|
||||||
getInspectorState: (handler: HookHandler<HookPayloads[Hooks.GET_INSPECTOR_STATE], TContext>) => any;
|
|
||||||
editInspectorState: (handler: HookHandler<HookPayloads[Hooks.EDIT_INSPECTOR_STATE], TContext>) => any;
|
|
||||||
setPluginSettings: (handler: HookHandler<HookPayloads[Hooks.SET_PLUGIN_SETTINGS], TContext>) => any;
|
|
||||||
}
|
|
1
node_modules/@vue/devtools-api/lib/esm/api/hooks.js
generated
vendored
1
node_modules/@vue/devtools-api/lib/esm/api/hooks.js
generated
vendored
|
@ -1 +0,0 @@
|
||||||
export {};
|
|
6
node_modules/@vue/devtools-api/lib/esm/api/index.d.ts
generated
vendored
6
node_modules/@vue/devtools-api/lib/esm/api/index.d.ts
generated
vendored
|
@ -1,6 +0,0 @@
|
||||||
export * from './api.js';
|
|
||||||
export * from './app.js';
|
|
||||||
export * from './component.js';
|
|
||||||
export * from './context.js';
|
|
||||||
export * from './hooks.js';
|
|
||||||
export * from './util.js';
|
|
6
node_modules/@vue/devtools-api/lib/esm/api/index.js
generated
vendored
6
node_modules/@vue/devtools-api/lib/esm/api/index.js
generated
vendored
|
@ -1,6 +0,0 @@
|
||||||
export * from './api.js';
|
|
||||||
export * from './app.js';
|
|
||||||
export * from './component.js';
|
|
||||||
export * from './context.js';
|
|
||||||
export * from './hooks.js';
|
|
||||||
export * from './util.js';
|
|
4
node_modules/@vue/devtools-api/lib/esm/api/util.d.ts
generated
vendored
4
node_modules/@vue/devtools-api/lib/esm/api/util.d.ts
generated
vendored
|
@ -1,4 +0,0 @@
|
||||||
export type ID = number | string;
|
|
||||||
export interface WithId {
|
|
||||||
id: ID;
|
|
||||||
}
|
|
1
node_modules/@vue/devtools-api/lib/esm/api/util.js
generated
vendored
1
node_modules/@vue/devtools-api/lib/esm/api/util.js
generated
vendored
|
@ -1 +0,0 @@
|
||||||
export {};
|
|
2
node_modules/@vue/devtools-api/lib/esm/const.d.ts
generated
vendored
2
node_modules/@vue/devtools-api/lib/esm/const.d.ts
generated
vendored
|
@ -1,2 +0,0 @@
|
||||||
export declare const HOOK_SETUP = "devtools-plugin:setup";
|
|
||||||
export declare const HOOK_PLUGIN_SETTINGS_SET = "plugin:settings:set";
|
|
2
node_modules/@vue/devtools-api/lib/esm/const.js
generated
vendored
2
node_modules/@vue/devtools-api/lib/esm/const.js
generated
vendored
|
@ -1,2 +0,0 @@
|
||||||
export const HOOK_SETUP = 'devtools-plugin:setup';
|
|
||||||
export const HOOK_PLUGIN_SETTINGS_SET = 'plugin:settings:set';
|
|
15
node_modules/@vue/devtools-api/lib/esm/env.d.ts
generated
vendored
15
node_modules/@vue/devtools-api/lib/esm/env.d.ts
generated
vendored
|
@ -1,15 +0,0 @@
|
||||||
import type { ApiProxy } from './proxy.js';
|
|
||||||
import type { PluginDescriptor, SetupFunction } from './index.js';
|
|
||||||
export interface PluginQueueItem {
|
|
||||||
pluginDescriptor: PluginDescriptor;
|
|
||||||
setupFn: SetupFunction;
|
|
||||||
proxy?: ApiProxy;
|
|
||||||
}
|
|
||||||
interface GlobalTarget {
|
|
||||||
__VUE_DEVTOOLS_PLUGINS__?: PluginQueueItem[];
|
|
||||||
__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__?: boolean;
|
|
||||||
}
|
|
||||||
export declare function getDevtoolsGlobalHook(): any;
|
|
||||||
export declare function getTarget(): GlobalTarget;
|
|
||||||
export declare const isProxyAvailable: boolean;
|
|
||||||
export {};
|
|
12
node_modules/@vue/devtools-api/lib/esm/env.js
generated
vendored
12
node_modules/@vue/devtools-api/lib/esm/env.js
generated
vendored
|
@ -1,12 +0,0 @@
|
||||||
export function getDevtoolsGlobalHook() {
|
|
||||||
return getTarget().__VUE_DEVTOOLS_GLOBAL_HOOK__;
|
|
||||||
}
|
|
||||||
export function getTarget() {
|
|
||||||
// @ts-expect-error navigator and windows are not available in all environments
|
|
||||||
return (typeof navigator !== 'undefined' && typeof window !== 'undefined')
|
|
||||||
? window
|
|
||||||
: typeof globalThis !== 'undefined'
|
|
||||||
? globalThis
|
|
||||||
: {};
|
|
||||||
}
|
|
||||||
export const isProxyAvailable = typeof Proxy === 'function';
|
|
18
node_modules/@vue/devtools-api/lib/esm/index.d.ts
generated
vendored
18
node_modules/@vue/devtools-api/lib/esm/index.d.ts
generated
vendored
|
@ -1,18 +0,0 @@
|
||||||
import type { DevtoolsPluginApi } from './api/index.js';
|
|
||||||
import type { ExtractSettingsTypes, PluginDescriptor, PluginSettingsItem } from './plugin.js';
|
|
||||||
export * from './api/index.js';
|
|
||||||
export * from './plugin.js';
|
|
||||||
export * from './time.js';
|
|
||||||
export { PluginQueueItem } from './env.js';
|
|
||||||
type Cast<A, B> = A extends B ? A : B;
|
|
||||||
type Narrowable = string | number | bigint | boolean;
|
|
||||||
type Narrow<A> = Cast<A, [] | (A extends Narrowable ? A : never) | ({
|
|
||||||
[K in keyof A]: Narrow<A[K]>;
|
|
||||||
})>;
|
|
||||||
type Exact<C, T> = {
|
|
||||||
[K in keyof C]: K extends keyof T ? T[K] : never;
|
|
||||||
};
|
|
||||||
export type SetupFunction<TSettings = any> = (api: DevtoolsPluginApi<TSettings>) => void;
|
|
||||||
export declare function setupDevtoolsPlugin<TDescriptor extends Exact<TDescriptor, PluginDescriptor>, TSettings = ExtractSettingsTypes<TDescriptor extends {
|
|
||||||
settings: infer S;
|
|
||||||
} ? S extends Record<string, PluginSettingsItem> ? S : Record<string, PluginSettingsItem> : Record<string, PluginSettingsItem>>>(pluginDescriptor: Narrow<TDescriptor>, setupFn: SetupFunction<TSettings>): void;
|
|
27
node_modules/@vue/devtools-api/lib/esm/index.js
generated
vendored
27
node_modules/@vue/devtools-api/lib/esm/index.js
generated
vendored
|
@ -1,27 +0,0 @@
|
||||||
import { getDevtoolsGlobalHook, getTarget, isProxyAvailable } from './env.js';
|
|
||||||
import { HOOK_SETUP } from './const.js';
|
|
||||||
import { ApiProxy } from './proxy.js';
|
|
||||||
export * from './api/index.js';
|
|
||||||
export * from './plugin.js';
|
|
||||||
export * from './time.js';
|
|
||||||
export function setupDevtoolsPlugin(pluginDescriptor, setupFn) {
|
|
||||||
const descriptor = pluginDescriptor;
|
|
||||||
const target = getTarget();
|
|
||||||
const hook = getDevtoolsGlobalHook();
|
|
||||||
const enableProxy = isProxyAvailable && descriptor.enableEarlyProxy;
|
|
||||||
if (hook && (target.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__ || !enableProxy)) {
|
|
||||||
hook.emit(HOOK_SETUP, pluginDescriptor, setupFn);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
const proxy = enableProxy ? new ApiProxy(descriptor, hook) : null;
|
|
||||||
const list = target.__VUE_DEVTOOLS_PLUGINS__ = target.__VUE_DEVTOOLS_PLUGINS__ || [];
|
|
||||||
list.push({
|
|
||||||
pluginDescriptor: descriptor,
|
|
||||||
setupFn,
|
|
||||||
proxy,
|
|
||||||
});
|
|
||||||
if (proxy) {
|
|
||||||
setupFn(proxy.proxiedTarget);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
47
node_modules/@vue/devtools-api/lib/esm/plugin.d.ts
generated
vendored
47
node_modules/@vue/devtools-api/lib/esm/plugin.d.ts
generated
vendored
|
@ -1,47 +0,0 @@
|
||||||
import type { App } from './api/index.js';
|
|
||||||
export interface PluginDescriptor {
|
|
||||||
id: string;
|
|
||||||
label: string;
|
|
||||||
app: App;
|
|
||||||
packageName?: string;
|
|
||||||
homepage?: string;
|
|
||||||
componentStateTypes?: string[];
|
|
||||||
logo?: string;
|
|
||||||
disableAppScope?: boolean;
|
|
||||||
disablePluginScope?: boolean;
|
|
||||||
/**
|
|
||||||
* Run the plugin setup and expose the api even if the devtools is not opened yet.
|
|
||||||
* Useful to record timeline events early.
|
|
||||||
*/
|
|
||||||
enableEarlyProxy?: boolean;
|
|
||||||
settings?: Record<string, PluginSettingsItem>;
|
|
||||||
}
|
|
||||||
export type PluginSettingsItem = {
|
|
||||||
label: string;
|
|
||||||
description?: string;
|
|
||||||
} & ({
|
|
||||||
type: 'boolean';
|
|
||||||
defaultValue: boolean;
|
|
||||||
} | {
|
|
||||||
type: 'choice';
|
|
||||||
defaultValue: string | number;
|
|
||||||
options: {
|
|
||||||
value: string | number;
|
|
||||||
label: string;
|
|
||||||
}[];
|
|
||||||
component?: 'select' | 'button-group';
|
|
||||||
} | {
|
|
||||||
type: 'text';
|
|
||||||
defaultValue: string;
|
|
||||||
});
|
|
||||||
type InferSettingsType<T extends PluginSettingsItem> = [T] extends [{
|
|
||||||
type: 'boolean';
|
|
||||||
}] ? boolean : [T] extends [{
|
|
||||||
type: 'choice';
|
|
||||||
}] ? T['options'][number]['value'] : [T] extends [{
|
|
||||||
type: 'text';
|
|
||||||
}] ? string : unknown;
|
|
||||||
export type ExtractSettingsTypes<O extends Record<string, PluginSettingsItem>> = {
|
|
||||||
[K in keyof O]: InferSettingsType<O[K]>;
|
|
||||||
};
|
|
||||||
export {};
|
|
1
node_modules/@vue/devtools-api/lib/esm/plugin.js
generated
vendored
1
node_modules/@vue/devtools-api/lib/esm/plugin.js
generated
vendored
|
@ -1 +0,0 @@
|
||||||
export {};
|
|
20
node_modules/@vue/devtools-api/lib/esm/proxy.d.ts
generated
vendored
20
node_modules/@vue/devtools-api/lib/esm/proxy.d.ts
generated
vendored
|
@ -1,20 +0,0 @@
|
||||||
import type { Context, DevtoolsPluginApi, Hookable } from './api/index.js';
|
|
||||||
import type { PluginDescriptor } from './plugin.js';
|
|
||||||
interface QueueItem {
|
|
||||||
method: string;
|
|
||||||
args: any[];
|
|
||||||
resolve?: (value?: any) => void;
|
|
||||||
}
|
|
||||||
export declare class ApiProxy<TTarget extends DevtoolsPluginApi<any> = DevtoolsPluginApi<any>> {
|
|
||||||
target: TTarget | null;
|
|
||||||
targetQueue: QueueItem[];
|
|
||||||
proxiedTarget: TTarget;
|
|
||||||
onQueue: QueueItem[];
|
|
||||||
proxiedOn: Hookable<Context>;
|
|
||||||
plugin: PluginDescriptor;
|
|
||||||
hook: any;
|
|
||||||
fallbacks: Record<string, any>;
|
|
||||||
constructor(plugin: PluginDescriptor, hook: any);
|
|
||||||
setRealTarget(target: TTarget): Promise<void>;
|
|
||||||
}
|
|
||||||
export {};
|
|
107
node_modules/@vue/devtools-api/lib/esm/proxy.js
generated
vendored
107
node_modules/@vue/devtools-api/lib/esm/proxy.js
generated
vendored
|
@ -1,107 +0,0 @@
|
||||||
import { HOOK_PLUGIN_SETTINGS_SET } from './const.js';
|
|
||||||
import { now } from './time.js';
|
|
||||||
export class ApiProxy {
|
|
||||||
constructor(plugin, hook) {
|
|
||||||
this.target = null;
|
|
||||||
this.targetQueue = [];
|
|
||||||
this.onQueue = [];
|
|
||||||
this.plugin = plugin;
|
|
||||||
this.hook = hook;
|
|
||||||
const defaultSettings = {};
|
|
||||||
if (plugin.settings) {
|
|
||||||
for (const id in plugin.settings) {
|
|
||||||
const item = plugin.settings[id];
|
|
||||||
defaultSettings[id] = item.defaultValue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const localSettingsSaveId = `__vue-devtools-plugin-settings__${plugin.id}`;
|
|
||||||
let currentSettings = Object.assign({}, defaultSettings);
|
|
||||||
try {
|
|
||||||
const raw = localStorage.getItem(localSettingsSaveId);
|
|
||||||
const data = JSON.parse(raw);
|
|
||||||
Object.assign(currentSettings, data);
|
|
||||||
}
|
|
||||||
catch (e) {
|
|
||||||
// noop
|
|
||||||
}
|
|
||||||
this.fallbacks = {
|
|
||||||
getSettings() {
|
|
||||||
return currentSettings;
|
|
||||||
},
|
|
||||||
setSettings(value) {
|
|
||||||
try {
|
|
||||||
localStorage.setItem(localSettingsSaveId, JSON.stringify(value));
|
|
||||||
}
|
|
||||||
catch (e) {
|
|
||||||
// noop
|
|
||||||
}
|
|
||||||
currentSettings = value;
|
|
||||||
},
|
|
||||||
now() {
|
|
||||||
return now();
|
|
||||||
},
|
|
||||||
};
|
|
||||||
if (hook) {
|
|
||||||
hook.on(HOOK_PLUGIN_SETTINGS_SET, (pluginId, value) => {
|
|
||||||
if (pluginId === this.plugin.id) {
|
|
||||||
this.fallbacks.setSettings(value);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
this.proxiedOn = new Proxy({}, {
|
|
||||||
get: (_target, prop) => {
|
|
||||||
if (this.target) {
|
|
||||||
return this.target.on[prop];
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return (...args) => {
|
|
||||||
this.onQueue.push({
|
|
||||||
method: prop,
|
|
||||||
args,
|
|
||||||
});
|
|
||||||
};
|
|
||||||
}
|
|
||||||
},
|
|
||||||
});
|
|
||||||
this.proxiedTarget = new Proxy({}, {
|
|
||||||
get: (_target, prop) => {
|
|
||||||
if (this.target) {
|
|
||||||
return this.target[prop];
|
|
||||||
}
|
|
||||||
else if (prop === 'on') {
|
|
||||||
return this.proxiedOn;
|
|
||||||
}
|
|
||||||
else if (Object.keys(this.fallbacks).includes(prop)) {
|
|
||||||
return (...args) => {
|
|
||||||
this.targetQueue.push({
|
|
||||||
method: prop,
|
|
||||||
args,
|
|
||||||
resolve: () => { },
|
|
||||||
});
|
|
||||||
return this.fallbacks[prop](...args);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return (...args) => {
|
|
||||||
return new Promise((resolve) => {
|
|
||||||
this.targetQueue.push({
|
|
||||||
method: prop,
|
|
||||||
args,
|
|
||||||
resolve,
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
|
||||||
}
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
async setRealTarget(target) {
|
|
||||||
this.target = target;
|
|
||||||
for (const item of this.onQueue) {
|
|
||||||
this.target.on[item.method](...item.args);
|
|
||||||
}
|
|
||||||
for (const item of this.targetQueue) {
|
|
||||||
item.resolve(await this.target[item.method](...item.args));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
2
node_modules/@vue/devtools-api/lib/esm/time.d.ts
generated
vendored
2
node_modules/@vue/devtools-api/lib/esm/time.d.ts
generated
vendored
|
@ -1,2 +0,0 @@
|
||||||
export declare function isPerformanceSupported(): boolean;
|
|
||||||
export declare function now(): number;
|
|
23
node_modules/@vue/devtools-api/lib/esm/time.js
generated
vendored
23
node_modules/@vue/devtools-api/lib/esm/time.js
generated
vendored
|
@ -1,23 +0,0 @@
|
||||||
let supported;
|
|
||||||
let perf;
|
|
||||||
export function isPerformanceSupported() {
|
|
||||||
var _a;
|
|
||||||
if (supported !== undefined) {
|
|
||||||
return supported;
|
|
||||||
}
|
|
||||||
if (typeof window !== 'undefined' && window.performance) {
|
|
||||||
supported = true;
|
|
||||||
perf = window.performance;
|
|
||||||
}
|
|
||||||
else if (typeof globalThis !== 'undefined' && ((_a = globalThis.perf_hooks) === null || _a === void 0 ? void 0 : _a.performance)) {
|
|
||||||
supported = true;
|
|
||||||
perf = globalThis.perf_hooks.performance;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
supported = false;
|
|
||||||
}
|
|
||||||
return supported;
|
|
||||||
}
|
|
||||||
export function now() {
|
|
||||||
return isPerformanceSupported() ? perf.now() : Date.now();
|
|
||||||
}
|
|
67
node_modules/@vue/devtools-api/package.json
generated
vendored
67
node_modules/@vue/devtools-api/package.json
generated
vendored
|
@ -1,67 +0,0 @@
|
||||||
{
|
|
||||||
"_from": "@vue/devtools-api@^6.6.3",
|
|
||||||
"_id": "@vue/devtools-api@6.6.4",
|
|
||||||
"_inBundle": false,
|
|
||||||
"_integrity": "sha512-sGhTPMuXqZ1rVOk32RylztWkfXTRhuS7vgAKv0zjqk8gbsHkJ7xfFf+jbySxt7tWObEJwyKaHMikV/WGDiQm8g==",
|
|
||||||
"_location": "/@vue/devtools-api",
|
|
||||||
"_phantomChildren": {},
|
|
||||||
"_requested": {
|
|
||||||
"type": "range",
|
|
||||||
"registry": true,
|
|
||||||
"raw": "@vue/devtools-api@^6.6.3",
|
|
||||||
"name": "@vue/devtools-api",
|
|
||||||
"escapedName": "@vue%2fdevtools-api",
|
|
||||||
"scope": "@vue",
|
|
||||||
"rawSpec": "^6.6.3",
|
|
||||||
"saveSpec": null,
|
|
||||||
"fetchSpec": "^6.6.3"
|
|
||||||
},
|
|
||||||
"_requiredBy": [
|
|
||||||
"/pinia"
|
|
||||||
],
|
|
||||||
"_resolved": "https://registry.npmmirror.com/@vue/devtools-api/-/devtools-api-6.6.4.tgz",
|
|
||||||
"_shasum": "cbe97fe0162b365edc1dba80e173f90492535343",
|
|
||||||
"_spec": "@vue/devtools-api@^6.6.3",
|
|
||||||
"_where": "D:\\FeiYi\\node_modules\\pinia",
|
|
||||||
"author": {
|
|
||||||
"name": "Guillaume Chau"
|
|
||||||
},
|
|
||||||
"browser": "lib/esm/index.js",
|
|
||||||
"bugs": {
|
|
||||||
"url": "https://github.com/vuejs/vue-devtools/issues"
|
|
||||||
},
|
|
||||||
"bundleDependencies": false,
|
|
||||||
"deprecated": false,
|
|
||||||
"description": "Interact with the Vue devtools from the page",
|
|
||||||
"devDependencies": {
|
|
||||||
"@types/node": "^20.11.16",
|
|
||||||
"@types/webpack-env": "^1.15.1",
|
|
||||||
"typescript": "^5.3.3"
|
|
||||||
},
|
|
||||||
"files": [
|
|
||||||
"lib/cjs",
|
|
||||||
"lib/esm"
|
|
||||||
],
|
|
||||||
"homepage": "https://github.com/vuejs/vue-devtools#readme",
|
|
||||||
"license": "MIT",
|
|
||||||
"main": "lib/cjs/index.js",
|
|
||||||
"module": "lib/esm/index.js",
|
|
||||||
"name": "@vue/devtools-api",
|
|
||||||
"publishConfig": {
|
|
||||||
"access": "public"
|
|
||||||
},
|
|
||||||
"repository": {
|
|
||||||
"url": "git+https://github.com/vuejs/vue-devtools.git",
|
|
||||||
"type": "git",
|
|
||||||
"directory": "packages/api"
|
|
||||||
},
|
|
||||||
"scripts": {
|
|
||||||
"build": "rimraf lib && yarn build:esm && yarn build:cjs",
|
|
||||||
"build:cjs": "tsc --module commonjs --outDir lib/cjs",
|
|
||||||
"build:esm": "tsc --module es2015 --outDir lib/esm -d",
|
|
||||||
"build:watch": "yarn tsc --module es2015 --outDir lib/esm -d -w --sourceMap"
|
|
||||||
},
|
|
||||||
"sideEffects": false,
|
|
||||||
"types": "lib/esm/index.d.ts",
|
|
||||||
"version": "6.6.4"
|
|
||||||
}
|
|
140
node_modules/mitt/package.json
generated
vendored
140
node_modules/mitt/package.json
generated
vendored
|
@ -1,37 +1,64 @@
|
||||||
{
|
{
|
||||||
"_from": "mitt",
|
|
||||||
"_id": "mitt@3.0.1",
|
|
||||||
"_inBundle": false,
|
|
||||||
"_integrity": "sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw==",
|
|
||||||
"_location": "/mitt",
|
|
||||||
"_phantomChildren": {},
|
|
||||||
"_requested": {
|
|
||||||
"type": "tag",
|
|
||||||
"registry": true,
|
|
||||||
"raw": "mitt",
|
|
||||||
"name": "mitt",
|
"name": "mitt",
|
||||||
"escapedName": "mitt",
|
"version": "3.0.1",
|
||||||
"rawSpec": "",
|
"description": "Tiny 200b functional Event Emitter / pubsub.",
|
||||||
"saveSpec": null,
|
"module": "dist/mitt.mjs",
|
||||||
"fetchSpec": "latest"
|
"main": "dist/mitt.js",
|
||||||
|
"jsnext:main": "dist/mitt.mjs",
|
||||||
|
"umd:main": "dist/mitt.umd.js",
|
||||||
|
"source": "src/index.ts",
|
||||||
|
"typings": "index.d.ts",
|
||||||
|
"exports": {
|
||||||
|
"types": "./index.d.ts",
|
||||||
|
"module": "./dist/mitt.mjs",
|
||||||
|
"import": "./dist/mitt.mjs",
|
||||||
|
"require": "./dist/mitt.js",
|
||||||
|
"default": "./dist/mitt.mjs"
|
||||||
},
|
},
|
||||||
"_requiredBy": [
|
"scripts": {
|
||||||
"#USER",
|
"test": "npm-run-all --silent typecheck lint mocha test-types",
|
||||||
"/"
|
"mocha": "mocha test",
|
||||||
|
"test-types": "tsc test/test-types-compilation.ts --noEmit --strict",
|
||||||
|
"lint": "eslint src test --ext ts --ext js",
|
||||||
|
"typecheck": "tsc --noEmit",
|
||||||
|
"bundle": "microbundle -f es,cjs,umd",
|
||||||
|
"build": "npm-run-all --silent clean -p bundle -s docs",
|
||||||
|
"clean": "rimraf dist",
|
||||||
|
"docs": "documentation readme src/index.ts --section API -q --parse-extension ts",
|
||||||
|
"release": "npm run -s build -s && npm t && git commit -am $npm_package_version && git tag $npm_package_version && git push && git push --tags && npm publish"
|
||||||
|
},
|
||||||
|
"repository": "developit/mitt",
|
||||||
|
"keywords": [
|
||||||
|
"events",
|
||||||
|
"eventemitter",
|
||||||
|
"emitter",
|
||||||
|
"pubsub"
|
||||||
],
|
],
|
||||||
"_resolved": "https://registry.npmmirror.com/mitt/-/mitt-3.0.1.tgz",
|
"homepage": "https://github.com/developit/mitt",
|
||||||
"_shasum": "ea36cf0cc30403601ae074c8f77b7092cdab36d1",
|
|
||||||
"_spec": "mitt",
|
|
||||||
"_where": "D:\\FeiYi",
|
|
||||||
"authors": [
|
"authors": [
|
||||||
"Jason Miller <jason@developit.ca>"
|
"Jason Miller <jason@developit.ca>"
|
||||||
],
|
],
|
||||||
"bugs": {
|
"license": "MIT",
|
||||||
"url": "https://github.com/developit/mitt/issues"
|
"files": [
|
||||||
|
"dist",
|
||||||
|
"index.d.ts"
|
||||||
|
],
|
||||||
|
"mocha": {
|
||||||
|
"extension": [
|
||||||
|
"ts"
|
||||||
|
],
|
||||||
|
"require": [
|
||||||
|
"ts-node/register",
|
||||||
|
"esm"
|
||||||
|
],
|
||||||
|
"spec": [
|
||||||
|
"test/*_test.ts"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"prettier": {
|
||||||
|
"singleQuote": true,
|
||||||
|
"trailingComma": "none"
|
||||||
},
|
},
|
||||||
"bundleDependencies": false,
|
|
||||||
"deprecated": false,
|
|
||||||
"description": "Tiny 200b functional Event Emitter / pubsub.",
|
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/chai": "^4.2.11",
|
"@types/chai": "^4.2.11",
|
||||||
"@types/mocha": "^7.0.2",
|
"@types/mocha": "^7.0.2",
|
||||||
|
@ -54,64 +81,5 @@
|
||||||
"sinon-chai": "^3.5.0",
|
"sinon-chai": "^3.5.0",
|
||||||
"ts-node": "^10.9.1",
|
"ts-node": "^10.9.1",
|
||||||
"typescript": "^4.9.5"
|
"typescript": "^4.9.5"
|
||||||
},
|
}
|
||||||
"exports": {
|
|
||||||
"types": "./index.d.ts",
|
|
||||||
"module": "./dist/mitt.mjs",
|
|
||||||
"import": "./dist/mitt.mjs",
|
|
||||||
"require": "./dist/mitt.js",
|
|
||||||
"default": "./dist/mitt.mjs"
|
|
||||||
},
|
|
||||||
"files": [
|
|
||||||
"dist",
|
|
||||||
"index.d.ts"
|
|
||||||
],
|
|
||||||
"homepage": "https://github.com/developit/mitt",
|
|
||||||
"jsnext:main": "dist/mitt.mjs",
|
|
||||||
"keywords": [
|
|
||||||
"events",
|
|
||||||
"eventemitter",
|
|
||||||
"emitter",
|
|
||||||
"pubsub"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
|
||||||
"main": "dist/mitt.js",
|
|
||||||
"mocha": {
|
|
||||||
"extension": [
|
|
||||||
"ts"
|
|
||||||
],
|
|
||||||
"require": [
|
|
||||||
"ts-node/register",
|
|
||||||
"esm"
|
|
||||||
],
|
|
||||||
"spec": [
|
|
||||||
"test/*_test.ts"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"module": "dist/mitt.mjs",
|
|
||||||
"name": "mitt",
|
|
||||||
"prettier": {
|
|
||||||
"singleQuote": true,
|
|
||||||
"trailingComma": "none"
|
|
||||||
},
|
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "git+https://github.com/developit/mitt.git"
|
|
||||||
},
|
|
||||||
"scripts": {
|
|
||||||
"build": "npm-run-all --silent clean -p bundle -s docs",
|
|
||||||
"bundle": "microbundle -f es,cjs,umd",
|
|
||||||
"clean": "rimraf dist",
|
|
||||||
"docs": "documentation readme src/index.ts --section API -q --parse-extension ts",
|
|
||||||
"lint": "eslint src test --ext ts --ext js",
|
|
||||||
"mocha": "mocha test",
|
|
||||||
"release": "npm run -s build -s && npm t && git commit -am $npm_package_version && git tag $npm_package_version && git push && git push --tags && npm publish",
|
|
||||||
"test": "npm-run-all --silent typecheck lint mocha test-types",
|
|
||||||
"test-types": "tsc test/test-types-compilation.ts --noEmit --strict",
|
|
||||||
"typecheck": "tsc --noEmit"
|
|
||||||
},
|
|
||||||
"source": "src/index.ts",
|
|
||||||
"typings": "index.d.ts",
|
|
||||||
"umd:main": "dist/mitt.umd.js",
|
|
||||||
"version": "3.0.1"
|
|
||||||
}
|
}
|
||||||
|
|
21
node_modules/pinia/LICENSE
generated
vendored
21
node_modules/pinia/LICENSE
generated
vendored
|
@ -1,21 +0,0 @@
|
||||||
The MIT License (MIT)
|
|
||||||
|
|
||||||
Copyright (c) 2019-present Eduardo San Martin Morote
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
SOFTWARE.
|
|
24
node_modules/pinia/README.md
generated
vendored
24
node_modules/pinia/README.md
generated
vendored
|
@ -1,24 +0,0 @@
|
||||||
<p align="center">
|
|
||||||
<a href="https://pinia.vuejs.org" target="_blank" rel="noopener noreferrer">
|
|
||||||
<img width="180" src="https://pinia.vuejs.org/logo.svg" alt="Pinia logo">
|
|
||||||
</a>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
# Pinia
|
|
||||||
|
|
||||||
> Intuitive, type safe and flexible Store for Vue
|
|
||||||
|
|
||||||
## 👉 [Demo with Vue 3 on StackBlitz](https://stackblitz.com/github/piniajs/example-vue-3-vite)
|
|
||||||
|
|
||||||
## Help me keep working on this project 💚
|
|
||||||
|
|
||||||
- [Become a Sponsor on GitHub](https://github.com/sponsors/posva)
|
|
||||||
- [One-time donation via PayPal](https://paypal.me/posva)
|
|
||||||
|
|
||||||
## Documentation
|
|
||||||
|
|
||||||
To learn more about Pinia, check [its documentation](https://pinia.vuejs.org).
|
|
||||||
|
|
||||||
## License
|
|
||||||
|
|
||||||
[MIT](http://opensource.org/licenses/MIT)
|
|
2060
node_modules/pinia/dist/pinia.cjs
generated
vendored
2060
node_modules/pinia/dist/pinia.cjs
generated
vendored
File diff suppressed because it is too large
Load Diff
1072
node_modules/pinia/dist/pinia.d.ts
generated
vendored
1072
node_modules/pinia/dist/pinia.d.ts
generated
vendored
File diff suppressed because it is too large
Load Diff
2035
node_modules/pinia/dist/pinia.esm-browser.js
generated
vendored
2035
node_modules/pinia/dist/pinia.esm-browser.js
generated
vendored
File diff suppressed because it is too large
Load Diff
2222
node_modules/pinia/dist/pinia.iife.js
generated
vendored
2222
node_modules/pinia/dist/pinia.iife.js
generated
vendored
File diff suppressed because it is too large
Load Diff
7
node_modules/pinia/dist/pinia.iife.prod.js
generated
vendored
7
node_modules/pinia/dist/pinia.iife.prod.js
generated
vendored
|
@ -1,7 +0,0 @@
|
||||||
/*!
|
|
||||||
* pinia v2.2.5
|
|
||||||
* (c) 2024 Eduardo San Martin Morote
|
|
||||||
* @license MIT
|
|
||||||
*/
|
|
||||||
var Pinia=function(t,e){"use strict";let n;const i=t=>n=t,s=Symbol();function o(t){return t&&"object"==typeof t&&"[object Object]"===Object.prototype.toString.call(t)&&"function"!=typeof t.toJSON}var r;t.MutationType=void 0,(r=t.MutationType||(t.MutationType={})).direct="direct",r.patchObject="patch object",r.patchFunction="patch function";const c="undefined"!=typeof window;const a=()=>{};function u(t,n,i,s=a){t.push(n);const o=()=>{const e=t.indexOf(n);e>-1&&(t.splice(e,1),s())};return!i&&e.getCurrentScope()&&e.onScopeDispose(o),o}function p(t,...e){t.slice().forEach((t=>{t(...e)}))}const f=t=>t(),h=Symbol(),l=Symbol();function d(t,n){t instanceof Map&&n instanceof Map?n.forEach(((e,n)=>t.set(n,e))):t instanceof Set&&n instanceof Set&&n.forEach(t.add,t);for(const i in n){if(!n.hasOwnProperty(i))continue;const s=n[i],r=t[i];t[i]=o(r)&&o(s)&&t.hasOwnProperty(i)&&!e.isRef(s)&&!e.isReactive(s)?d(r,s):s}return t}const y=Symbol(),v=new WeakMap;function $(t){return e.isVue2?!v.has(t):!o(t)||!t.hasOwnProperty(y)}const{assign:_}=Object;function b(n,s,o={},r,c,y){let v;const b=_({actions:{}},o),j={deep:!0};let S,m,O,g=[],R=[];const P=r.state.value[n];let V;function w(i){let s;S=m=!1,"function"==typeof i?(i(r.state.value[n]),s={type:t.MutationType.patchFunction,storeId:n,events:O}):(d(r.state.value[n],i),s={type:t.MutationType.patchObject,payload:i,storeId:n,events:O});const o=V=Symbol();e.nextTick().then((()=>{V===o&&(S=!0)})),m=!0,p(g,s,r.state.value[n])}y||P||(e.isVue2?e.set(r.state.value,n,{}):r.state.value[n]={}),e.ref({});const M=y?function(){const{state:t}=o,e=t?t():{};this.$patch((t=>{_(t,e)}))}:a;const A=(t,e="")=>{if(h in t)return t[l]=e,t;const s=function(){i(r);const e=Array.from(arguments),o=[],c=[];let a;p(R,{args:e,name:s[l],store:T,after:function(t){o.push(t)},onError:function(t){c.push(t)}});try{a=t.apply(this&&this.$id===n?this:T,e)}catch(t){throw p(c,t),t}return a instanceof Promise?a.then((t=>(p(o,t),t))).catch((t=>(p(c,t),Promise.reject(t)))):(p(o,a),a)};return s[h]=!0,s[l]=e,s},k={_p:r,$id:n,$onAction:u.bind(null,R),$patch:w,$reset:M,$subscribe(i,s={}){const o=u(g,i,s.detached,(()=>c())),c=v.run((()=>e.watch((()=>r.state.value[n]),(e=>{("sync"===s.flush?m:S)&&i({storeId:n,type:t.MutationType.direct,events:O},e)}),_({},j,s))));return o},$dispose:function(){v.stop(),g=[],R=[],r._s.delete(n)}};e.isVue2&&(k._r=!1);const T=e.reactive(k);r._s.set(n,T);const x=(r._a&&r._a.runWithContext||f)((()=>r._e.run((()=>(v=e.effectScope()).run((()=>s({action:A})))))));for(const t in x){const i=x[t];if(e.isRef(i)&&(!e.isRef(E=i)||!E.effect)||e.isReactive(i))y||(P&&$(i)&&(e.isRef(i)?i.value=P[t]:d(i,P[t])),e.isVue2?e.set(r.state.value[n],t,i):r.state.value[n][t]=i);else if("function"==typeof i){const n=A(i,t);e.isVue2?e.set(x,t,n):x[t]=n,b.actions[t]=i}}var E;return e.isVue2?Object.keys(x).forEach((t=>{e.set(T,t,x[t])})):(_(T,x),_(e.toRaw(T),x)),Object.defineProperty(T,"$state",{get:()=>r.state.value[n],set:t=>{w((e=>{_(e,t)}))}}),e.isVue2&&(T._r=!0),r._p.forEach((t=>{_(T,v.run((()=>t({store:T,app:r._a,pinia:r,options:b}))))})),P&&y&&o.hydrate&&o.hydrate(T.$state,P),S=!0,m=!0,T}
|
|
||||||
/*! #__NO_SIDE_EFFECTS__ */let j="Store";function S(t,e){return Array.isArray(e)?e.reduce(((e,n)=>(e[n]=function(){return t(this.$pinia)[n]},e)),{}):Object.keys(e).reduce(((n,i)=>(n[i]=function(){const n=t(this.$pinia),s=e[i];return"function"==typeof s?s.call(this,n):n[s]},n)),{})}const m=S;return t.PiniaVuePlugin=function(t){t.mixin({beforeCreate(){const t=this.$options;if(t.pinia){const e=t.pinia;if(!this._provided){const t={};Object.defineProperty(this,"_provided",{get:()=>t,set:e=>Object.assign(t,e)})}this._provided[s]=e,this.$pinia||(this.$pinia=e),e._a=this,c&&i(e)}else!this.$pinia&&t.parent&&t.parent.$pinia&&(this.$pinia=t.parent.$pinia)},destroyed(){delete this._pStores}})},t.acceptHMRUpdate=function(t,e){return()=>{}},t.createPinia=function(){const t=e.effectScope(!0),n=t.run((()=>e.ref({})));let o=[],r=[];const c=e.markRaw({install(t){i(c),e.isVue2||(c._a=t,t.provide(s,c),t.config.globalProperties.$pinia=c,r.forEach((t=>o.push(t))),r=[])},use(t){return this._a||e.isVue2?o.push(t):r.push(t),this},_p:o,_a:null,_e:t,_s:new Map,state:n});return c},t.defineStore=function(t,o,r){let c,a;const u="function"==typeof o;function p(t,r){const p=e.hasInjectionContext();(t=t||(p?e.inject(s,null):null))&&i(t),(t=n)._s.has(c)||(u?b(c,o,a,t):function(t,n,s){const{state:o,actions:r,getters:c}=n,a=s.state.value[t];let u;u=b(t,(function(){a||(e.isVue2?e.set(s.state.value,t,o?o():{}):s.state.value[t]=o?o():{});const n=e.toRefs(s.state.value[t]);return _(n,r,Object.keys(c||{}).reduce(((n,o)=>(n[o]=e.markRaw(e.computed((()=>{i(s);const n=s._s.get(t);if(!e.isVue2||n._r)return c[o].call(n,n)}))),n)),{}))}),n,s,0,!0)}(c,a,t));return t._s.get(c)}return"string"==typeof t?(c=t,a=u?r:o):(a=t,c=t.id),p.$id=c,p},t.disposePinia=function(t){t._e.stop(),t._s.clear(),t._p.splice(0),t.state.value={},t._a=null},t.getActivePinia=()=>e.hasInjectionContext()&&e.inject(s)||n,t.mapActions=function(t,e){return Array.isArray(e)?e.reduce(((e,n)=>(e[n]=function(...e){return t(this.$pinia)[n](...e)},e)),{}):Object.keys(e).reduce(((n,i)=>(n[i]=function(...n){return t(this.$pinia)[e[i]](...n)},n)),{})},t.mapGetters=m,t.mapState=S,t.mapStores=function(...t){return t.reduce(((t,e)=>(t[e.$id+j]=function(){return e(this.$pinia)},t)),{})},t.mapWritableState=function(t,e){return Array.isArray(e)?e.reduce(((e,n)=>(e[n]={get(){return t(this.$pinia)[n]},set(e){return t(this.$pinia)[n]=e}},e)),{}):Object.keys(e).reduce(((n,i)=>(n[i]={get(){return t(this.$pinia)[e[i]]},set(n){return t(this.$pinia)[e[i]]=n}},n)),{})},t.setActivePinia=i,t.setMapStoreSuffix=function(t){j=t},t.shouldHydrate=$,t.skipHydrate=function(t){return e.isVue2?v.set(t,1)&&t:Object.defineProperty(t,y,{})},t.storeToRefs=function(t){if(e.isVue2)return e.toRefs(t);{const n=e.toRaw(t),i={};for(const s in n){const o=n[s];(e.isRef(o)||e.isReactive(o))&&(i[s]=e.toRef(t,s))}return i}},t}({},VueDemi);
|
|
2043
node_modules/pinia/dist/pinia.mjs
generated
vendored
2043
node_modules/pinia/dist/pinia.mjs
generated
vendored
File diff suppressed because it is too large
Load Diff
845
node_modules/pinia/dist/pinia.prod.cjs
generated
vendored
845
node_modules/pinia/dist/pinia.prod.cjs
generated
vendored
|
@ -1,845 +0,0 @@
|
||||||
/*!
|
|
||||||
* pinia v2.2.5
|
|
||||||
* (c) 2024 Eduardo San Martin Morote
|
|
||||||
* @license MIT
|
|
||||||
*/
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
var vueDemi = require('vue-demi');
|
|
||||||
|
|
||||||
/**
|
|
||||||
* setActivePinia must be called to handle SSR at the top of functions like
|
|
||||||
* `fetch`, `setup`, `serverPrefetch` and others
|
|
||||||
*/
|
|
||||||
let activePinia;
|
|
||||||
/**
|
|
||||||
* Sets or unsets the active pinia. Used in SSR and internally when calling
|
|
||||||
* actions and getters
|
|
||||||
*
|
|
||||||
* @param pinia - Pinia instance
|
|
||||||
*/
|
|
||||||
// @ts-expect-error: cannot constrain the type of the return
|
|
||||||
const setActivePinia = (pinia) => (activePinia = pinia);
|
|
||||||
/**
|
|
||||||
* Get the currently active pinia if there is any.
|
|
||||||
*/
|
|
||||||
const getActivePinia = () => (vueDemi.hasInjectionContext() && vueDemi.inject(piniaSymbol)) || activePinia;
|
|
||||||
const piniaSymbol = (/* istanbul ignore next */ Symbol());
|
|
||||||
|
|
||||||
function isPlainObject(
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
||||||
o) {
|
|
||||||
return (o &&
|
|
||||||
typeof o === 'object' &&
|
|
||||||
Object.prototype.toString.call(o) === '[object Object]' &&
|
|
||||||
typeof o.toJSON !== 'function');
|
|
||||||
}
|
|
||||||
// type DeepReadonly<T> = { readonly [P in keyof T]: DeepReadonly<T[P]> }
|
|
||||||
// TODO: can we change these to numbers?
|
|
||||||
/**
|
|
||||||
* Possible types for SubscriptionCallback
|
|
||||||
*/
|
|
||||||
exports.MutationType = void 0;
|
|
||||||
(function (MutationType) {
|
|
||||||
/**
|
|
||||||
* Direct mutation of the state:
|
|
||||||
*
|
|
||||||
* - `store.name = 'new name'`
|
|
||||||
* - `store.$state.name = 'new name'`
|
|
||||||
* - `store.list.push('new item')`
|
|
||||||
*/
|
|
||||||
MutationType["direct"] = "direct";
|
|
||||||
/**
|
|
||||||
* Mutated the state with `$patch` and an object
|
|
||||||
*
|
|
||||||
* - `store.$patch({ name: 'newName' })`
|
|
||||||
*/
|
|
||||||
MutationType["patchObject"] = "patch object";
|
|
||||||
/**
|
|
||||||
* Mutated the state with `$patch` and a function
|
|
||||||
*
|
|
||||||
* - `store.$patch(state => state.name = 'newName')`
|
|
||||||
*/
|
|
||||||
MutationType["patchFunction"] = "patch function";
|
|
||||||
// maybe reset? for $state = {} and $reset
|
|
||||||
})(exports.MutationType || (exports.MutationType = {}));
|
|
||||||
|
|
||||||
const IS_CLIENT = typeof window !== 'undefined';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a Pinia instance to be used by the application
|
|
||||||
*/
|
|
||||||
function createPinia() {
|
|
||||||
const scope = vueDemi.effectScope(true);
|
|
||||||
// NOTE: here we could check the window object for a state and directly set it
|
|
||||||
// if there is anything like it with Vue 3 SSR
|
|
||||||
const state = scope.run(() => vueDemi.ref({}));
|
|
||||||
let _p = [];
|
|
||||||
// plugins added before calling app.use(pinia)
|
|
||||||
let toBeInstalled = [];
|
|
||||||
const pinia = vueDemi.markRaw({
|
|
||||||
install(app) {
|
|
||||||
// this allows calling useStore() outside of a component setup after
|
|
||||||
// installing pinia's plugin
|
|
||||||
setActivePinia(pinia);
|
|
||||||
if (!vueDemi.isVue2) {
|
|
||||||
pinia._a = app;
|
|
||||||
app.provide(piniaSymbol, pinia);
|
|
||||||
app.config.globalProperties.$pinia = pinia;
|
|
||||||
toBeInstalled.forEach((plugin) => _p.push(plugin));
|
|
||||||
toBeInstalled = [];
|
|
||||||
}
|
|
||||||
},
|
|
||||||
use(plugin) {
|
|
||||||
if (!this._a && !vueDemi.isVue2) {
|
|
||||||
toBeInstalled.push(plugin);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
_p.push(plugin);
|
|
||||||
}
|
|
||||||
return this;
|
|
||||||
},
|
|
||||||
_p,
|
|
||||||
// it's actually undefined here
|
|
||||||
// @ts-expect-error
|
|
||||||
_a: null,
|
|
||||||
_e: scope,
|
|
||||||
_s: new Map(),
|
|
||||||
state,
|
|
||||||
});
|
|
||||||
return pinia;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Dispose a Pinia instance by stopping its effectScope and removing the state, plugins and stores. This is mostly
|
|
||||||
* useful in tests, with both a testing pinia or a regular pinia and in applications that use multiple pinia instances.
|
|
||||||
* Once disposed, the pinia instance cannot be used anymore.
|
|
||||||
*
|
|
||||||
* @param pinia - pinia instance
|
|
||||||
*/
|
|
||||||
function disposePinia(pinia) {
|
|
||||||
pinia._e.stop();
|
|
||||||
pinia._s.clear();
|
|
||||||
pinia._p.splice(0);
|
|
||||||
pinia.state.value = {};
|
|
||||||
// @ts-expect-error: non valid
|
|
||||||
pinia._a = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates an _accept_ function to pass to `import.meta.hot` in Vite applications.
|
|
||||||
*
|
|
||||||
* @example
|
|
||||||
* ```js
|
|
||||||
* const useUser = defineStore(...)
|
|
||||||
* if (import.meta.hot) {
|
|
||||||
* import.meta.hot.accept(acceptHMRUpdate(useUser, import.meta.hot))
|
|
||||||
* }
|
|
||||||
* ```
|
|
||||||
*
|
|
||||||
* @param initialUseStore - return of the defineStore to hot update
|
|
||||||
* @param hot - `import.meta.hot`
|
|
||||||
*/
|
|
||||||
function acceptHMRUpdate(initialUseStore, hot) {
|
|
||||||
// strip as much as possible from iife.prod
|
|
||||||
{
|
|
||||||
return () => { };
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const noop = () => { };
|
|
||||||
function addSubscription(subscriptions, callback, detached, onCleanup = noop) {
|
|
||||||
subscriptions.push(callback);
|
|
||||||
const removeSubscription = () => {
|
|
||||||
const idx = subscriptions.indexOf(callback);
|
|
||||||
if (idx > -1) {
|
|
||||||
subscriptions.splice(idx, 1);
|
|
||||||
onCleanup();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
if (!detached && vueDemi.getCurrentScope()) {
|
|
||||||
vueDemi.onScopeDispose(removeSubscription);
|
|
||||||
}
|
|
||||||
return removeSubscription;
|
|
||||||
}
|
|
||||||
function triggerSubscriptions(subscriptions, ...args) {
|
|
||||||
subscriptions.slice().forEach((callback) => {
|
|
||||||
callback(...args);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
const fallbackRunWithContext = (fn) => fn();
|
|
||||||
/**
|
|
||||||
* Marks a function as an action for `$onAction`
|
|
||||||
* @internal
|
|
||||||
*/
|
|
||||||
const ACTION_MARKER = Symbol();
|
|
||||||
/**
|
|
||||||
* Action name symbol. Allows to add a name to an action after defining it
|
|
||||||
* @internal
|
|
||||||
*/
|
|
||||||
const ACTION_NAME = Symbol();
|
|
||||||
function mergeReactiveObjects(target, patchToApply) {
|
|
||||||
// Handle Map instances
|
|
||||||
if (target instanceof Map && patchToApply instanceof Map) {
|
|
||||||
patchToApply.forEach((value, key) => target.set(key, value));
|
|
||||||
}
|
|
||||||
else if (target instanceof Set && patchToApply instanceof Set) {
|
|
||||||
// Handle Set instances
|
|
||||||
patchToApply.forEach(target.add, target);
|
|
||||||
}
|
|
||||||
// no need to go through symbols because they cannot be serialized anyway
|
|
||||||
for (const key in patchToApply) {
|
|
||||||
if (!patchToApply.hasOwnProperty(key))
|
|
||||||
continue;
|
|
||||||
const subPatch = patchToApply[key];
|
|
||||||
const targetValue = target[key];
|
|
||||||
if (isPlainObject(targetValue) &&
|
|
||||||
isPlainObject(subPatch) &&
|
|
||||||
target.hasOwnProperty(key) &&
|
|
||||||
!vueDemi.isRef(subPatch) &&
|
|
||||||
!vueDemi.isReactive(subPatch)) {
|
|
||||||
// NOTE: here I wanted to warn about inconsistent types but it's not possible because in setup stores one might
|
|
||||||
// start the value of a property as a certain type e.g. a Map, and then for some reason, during SSR, change that
|
|
||||||
// to `undefined`. When trying to hydrate, we want to override the Map with `undefined`.
|
|
||||||
target[key] = mergeReactiveObjects(targetValue, subPatch);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// @ts-expect-error: subPatch is a valid value
|
|
||||||
target[key] = subPatch;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return target;
|
|
||||||
}
|
|
||||||
const skipHydrateSymbol = /* istanbul ignore next */ Symbol();
|
|
||||||
const skipHydrateMap = /*#__PURE__*/ new WeakMap();
|
|
||||||
/**
|
|
||||||
* Tells Pinia to skip the hydration process of a given object. This is useful in setup stores (only) when you return a
|
|
||||||
* stateful object in the store but it isn't really state. e.g. returning a router instance in a setup store.
|
|
||||||
*
|
|
||||||
* @param obj - target object
|
|
||||||
* @returns obj
|
|
||||||
*/
|
|
||||||
function skipHydrate(obj) {
|
|
||||||
return vueDemi.isVue2
|
|
||||||
? // in @vue/composition-api, the refs are sealed so defineProperty doesn't work...
|
|
||||||
/* istanbul ignore next */ skipHydrateMap.set(obj, 1) && obj
|
|
||||||
: Object.defineProperty(obj, skipHydrateSymbol, {});
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Returns whether a value should be hydrated
|
|
||||||
*
|
|
||||||
* @param obj - target variable
|
|
||||||
* @returns true if `obj` should be hydrated
|
|
||||||
*/
|
|
||||||
function shouldHydrate(obj) {
|
|
||||||
return vueDemi.isVue2
|
|
||||||
? /* istanbul ignore next */ !skipHydrateMap.has(obj)
|
|
||||||
: !isPlainObject(obj) || !obj.hasOwnProperty(skipHydrateSymbol);
|
|
||||||
}
|
|
||||||
const { assign } = Object;
|
|
||||||
function isComputed(o) {
|
|
||||||
return !!(vueDemi.isRef(o) && o.effect);
|
|
||||||
}
|
|
||||||
function createOptionsStore(id, options, pinia, hot) {
|
|
||||||
const { state, actions, getters } = options;
|
|
||||||
const initialState = pinia.state.value[id];
|
|
||||||
let store;
|
|
||||||
function setup() {
|
|
||||||
if (!initialState && (!false)) {
|
|
||||||
/* istanbul ignore if */
|
|
||||||
if (vueDemi.isVue2) {
|
|
||||||
vueDemi.set(pinia.state.value, id, state ? state() : {});
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
pinia.state.value[id] = state ? state() : {};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// avoid creating a state in pinia.state.value
|
|
||||||
const localState = vueDemi.toRefs(pinia.state.value[id]);
|
|
||||||
return assign(localState, actions, Object.keys(getters || {}).reduce((computedGetters, name) => {
|
|
||||||
computedGetters[name] = vueDemi.markRaw(vueDemi.computed(() => {
|
|
||||||
setActivePinia(pinia);
|
|
||||||
// it was created just before
|
|
||||||
const store = pinia._s.get(id);
|
|
||||||
// allow cross using stores
|
|
||||||
/* istanbul ignore if */
|
|
||||||
if (vueDemi.isVue2 && !store._r)
|
|
||||||
return;
|
|
||||||
// @ts-expect-error
|
|
||||||
// return getters![name].call(context, context)
|
|
||||||
// TODO: avoid reading the getter while assigning with a global variable
|
|
||||||
return getters[name].call(store, store);
|
|
||||||
}));
|
|
||||||
return computedGetters;
|
|
||||||
}, {}));
|
|
||||||
}
|
|
||||||
store = createSetupStore(id, setup, options, pinia, hot, true);
|
|
||||||
return store;
|
|
||||||
}
|
|
||||||
function createSetupStore($id, setup, options = {}, pinia, hot, isOptionsStore) {
|
|
||||||
let scope;
|
|
||||||
const optionsForPlugin = assign({ actions: {} }, options);
|
|
||||||
// watcher options for $subscribe
|
|
||||||
const $subscribeOptions = { deep: true };
|
|
||||||
// internal state
|
|
||||||
let isListening; // set to true at the end
|
|
||||||
let isSyncListening; // set to true at the end
|
|
||||||
let subscriptions = [];
|
|
||||||
let actionSubscriptions = [];
|
|
||||||
let debuggerEvents;
|
|
||||||
const initialState = pinia.state.value[$id];
|
|
||||||
// avoid setting the state for option stores if it is set
|
|
||||||
// by the setup
|
|
||||||
if (!isOptionsStore && !initialState && (!false)) {
|
|
||||||
/* istanbul ignore if */
|
|
||||||
if (vueDemi.isVue2) {
|
|
||||||
vueDemi.set(pinia.state.value, $id, {});
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
pinia.state.value[$id] = {};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
vueDemi.ref({});
|
|
||||||
// avoid triggering too many listeners
|
|
||||||
// https://github.com/vuejs/pinia/issues/1129
|
|
||||||
let activeListener;
|
|
||||||
function $patch(partialStateOrMutator) {
|
|
||||||
let subscriptionMutation;
|
|
||||||
isListening = isSyncListening = false;
|
|
||||||
if (typeof partialStateOrMutator === 'function') {
|
|
||||||
partialStateOrMutator(pinia.state.value[$id]);
|
|
||||||
subscriptionMutation = {
|
|
||||||
type: exports.MutationType.patchFunction,
|
|
||||||
storeId: $id,
|
|
||||||
events: debuggerEvents,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
mergeReactiveObjects(pinia.state.value[$id], partialStateOrMutator);
|
|
||||||
subscriptionMutation = {
|
|
||||||
type: exports.MutationType.patchObject,
|
|
||||||
payload: partialStateOrMutator,
|
|
||||||
storeId: $id,
|
|
||||||
events: debuggerEvents,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
const myListenerId = (activeListener = Symbol());
|
|
||||||
vueDemi.nextTick().then(() => {
|
|
||||||
if (activeListener === myListenerId) {
|
|
||||||
isListening = true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
isSyncListening = true;
|
|
||||||
// because we paused the watcher, we need to manually call the subscriptions
|
|
||||||
triggerSubscriptions(subscriptions, subscriptionMutation, pinia.state.value[$id]);
|
|
||||||
}
|
|
||||||
const $reset = isOptionsStore
|
|
||||||
? function $reset() {
|
|
||||||
const { state } = options;
|
|
||||||
const newState = state ? state() : {};
|
|
||||||
// we use a patch to group all changes into one single subscription
|
|
||||||
this.$patch(($state) => {
|
|
||||||
// @ts-expect-error: FIXME: shouldn't error?
|
|
||||||
assign($state, newState);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
: /* istanbul ignore next */
|
|
||||||
noop;
|
|
||||||
function $dispose() {
|
|
||||||
scope.stop();
|
|
||||||
subscriptions = [];
|
|
||||||
actionSubscriptions = [];
|
|
||||||
pinia._s.delete($id);
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Helper that wraps function so it can be tracked with $onAction
|
|
||||||
* @param fn - action to wrap
|
|
||||||
* @param name - name of the action
|
|
||||||
*/
|
|
||||||
const action = (fn, name = '') => {
|
|
||||||
if (ACTION_MARKER in fn) {
|
|
||||||
fn[ACTION_NAME] = name;
|
|
||||||
return fn;
|
|
||||||
}
|
|
||||||
const wrappedAction = function () {
|
|
||||||
setActivePinia(pinia);
|
|
||||||
const args = Array.from(arguments);
|
|
||||||
const afterCallbackList = [];
|
|
||||||
const onErrorCallbackList = [];
|
|
||||||
function after(callback) {
|
|
||||||
afterCallbackList.push(callback);
|
|
||||||
}
|
|
||||||
function onError(callback) {
|
|
||||||
onErrorCallbackList.push(callback);
|
|
||||||
}
|
|
||||||
// @ts-expect-error
|
|
||||||
triggerSubscriptions(actionSubscriptions, {
|
|
||||||
args,
|
|
||||||
name: wrappedAction[ACTION_NAME],
|
|
||||||
store,
|
|
||||||
after,
|
|
||||||
onError,
|
|
||||||
});
|
|
||||||
let ret;
|
|
||||||
try {
|
|
||||||
ret = fn.apply(this && this.$id === $id ? this : store, args);
|
|
||||||
// handle sync errors
|
|
||||||
}
|
|
||||||
catch (error) {
|
|
||||||
triggerSubscriptions(onErrorCallbackList, error);
|
|
||||||
throw error;
|
|
||||||
}
|
|
||||||
if (ret instanceof Promise) {
|
|
||||||
return ret
|
|
||||||
.then((value) => {
|
|
||||||
triggerSubscriptions(afterCallbackList, value);
|
|
||||||
return value;
|
|
||||||
})
|
|
||||||
.catch((error) => {
|
|
||||||
triggerSubscriptions(onErrorCallbackList, error);
|
|
||||||
return Promise.reject(error);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
// trigger after callbacks
|
|
||||||
triggerSubscriptions(afterCallbackList, ret);
|
|
||||||
return ret;
|
|
||||||
};
|
|
||||||
wrappedAction[ACTION_MARKER] = true;
|
|
||||||
wrappedAction[ACTION_NAME] = name; // will be set later
|
|
||||||
// @ts-expect-error: we are intentionally limiting the returned type to just Fn
|
|
||||||
// because all the added properties are internals that are exposed through `$onAction()` only
|
|
||||||
return wrappedAction;
|
|
||||||
};
|
|
||||||
const partialStore = {
|
|
||||||
_p: pinia,
|
|
||||||
// _s: scope,
|
|
||||||
$id,
|
|
||||||
$onAction: addSubscription.bind(null, actionSubscriptions),
|
|
||||||
$patch,
|
|
||||||
$reset,
|
|
||||||
$subscribe(callback, options = {}) {
|
|
||||||
const removeSubscription = addSubscription(subscriptions, callback, options.detached, () => stopWatcher());
|
|
||||||
const stopWatcher = scope.run(() => vueDemi.watch(() => pinia.state.value[$id], (state) => {
|
|
||||||
if (options.flush === 'sync' ? isSyncListening : isListening) {
|
|
||||||
callback({
|
|
||||||
storeId: $id,
|
|
||||||
type: exports.MutationType.direct,
|
|
||||||
events: debuggerEvents,
|
|
||||||
}, state);
|
|
||||||
}
|
|
||||||
}, assign({}, $subscribeOptions, options)));
|
|
||||||
return removeSubscription;
|
|
||||||
},
|
|
||||||
$dispose,
|
|
||||||
};
|
|
||||||
/* istanbul ignore if */
|
|
||||||
if (vueDemi.isVue2) {
|
|
||||||
// start as non ready
|
|
||||||
partialStore._r = false;
|
|
||||||
}
|
|
||||||
const store = vueDemi.reactive(partialStore);
|
|
||||||
// store the partial store now so the setup of stores can instantiate each other before they are finished without
|
|
||||||
// creating infinite loops.
|
|
||||||
pinia._s.set($id, store);
|
|
||||||
const runWithContext = (pinia._a && pinia._a.runWithContext) || fallbackRunWithContext;
|
|
||||||
// TODO: idea create skipSerialize that marks properties as non serializable and they are skipped
|
|
||||||
const setupStore = runWithContext(() => pinia._e.run(() => (scope = vueDemi.effectScope()).run(() => setup({ action }))));
|
|
||||||
// overwrite existing actions to support $onAction
|
|
||||||
for (const key in setupStore) {
|
|
||||||
const prop = setupStore[key];
|
|
||||||
if ((vueDemi.isRef(prop) && !isComputed(prop)) || vueDemi.isReactive(prop)) {
|
|
||||||
// mark it as a piece of state to be serialized
|
|
||||||
if (!isOptionsStore) {
|
|
||||||
// in setup stores we must hydrate the state and sync pinia state tree with the refs the user just created
|
|
||||||
if (initialState && shouldHydrate(prop)) {
|
|
||||||
if (vueDemi.isRef(prop)) {
|
|
||||||
prop.value = initialState[key];
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// probably a reactive object, lets recursively assign
|
|
||||||
// @ts-expect-error: prop is unknown
|
|
||||||
mergeReactiveObjects(prop, initialState[key]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// transfer the ref to the pinia state to keep everything in sync
|
|
||||||
/* istanbul ignore if */
|
|
||||||
if (vueDemi.isVue2) {
|
|
||||||
vueDemi.set(pinia.state.value[$id], key, prop);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
pinia.state.value[$id][key] = prop;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// action
|
|
||||||
}
|
|
||||||
else if (typeof prop === 'function') {
|
|
||||||
const actionValue = action(prop, key);
|
|
||||||
// this a hot module replacement store because the hotUpdate method needs
|
|
||||||
// to do it with the right context
|
|
||||||
/* istanbul ignore if */
|
|
||||||
if (vueDemi.isVue2) {
|
|
||||||
vueDemi.set(setupStore, key, actionValue);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// @ts-expect-error
|
|
||||||
setupStore[key] = actionValue;
|
|
||||||
}
|
|
||||||
// list actions so they can be used in plugins
|
|
||||||
// @ts-expect-error
|
|
||||||
optionsForPlugin.actions[key] = prop;
|
|
||||||
}
|
|
||||||
else ;
|
|
||||||
}
|
|
||||||
// add the state, getters, and action properties
|
|
||||||
/* istanbul ignore if */
|
|
||||||
if (vueDemi.isVue2) {
|
|
||||||
Object.keys(setupStore).forEach((key) => {
|
|
||||||
vueDemi.set(store, key, setupStore[key]);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
assign(store, setupStore);
|
|
||||||
// allows retrieving reactive objects with `storeToRefs()`. Must be called after assigning to the reactive object.
|
|
||||||
// Make `storeToRefs()` work with `reactive()` #799
|
|
||||||
assign(vueDemi.toRaw(store), setupStore);
|
|
||||||
}
|
|
||||||
// use this instead of a computed with setter to be able to create it anywhere
|
|
||||||
// without linking the computed lifespan to wherever the store is first
|
|
||||||
// created.
|
|
||||||
Object.defineProperty(store, '$state', {
|
|
||||||
get: () => (pinia.state.value[$id]),
|
|
||||||
set: (state) => {
|
|
||||||
$patch(($state) => {
|
|
||||||
// @ts-expect-error: FIXME: shouldn't error?
|
|
||||||
assign($state, state);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
});
|
|
||||||
/* istanbul ignore if */
|
|
||||||
if (vueDemi.isVue2) {
|
|
||||||
// mark the store as ready before plugins
|
|
||||||
store._r = true;
|
|
||||||
}
|
|
||||||
// apply all plugins
|
|
||||||
pinia._p.forEach((extender) => {
|
|
||||||
/* istanbul ignore else */
|
|
||||||
{
|
|
||||||
assign(store, scope.run(() => extender({
|
|
||||||
store: store,
|
|
||||||
app: pinia._a,
|
|
||||||
pinia,
|
|
||||||
options: optionsForPlugin,
|
|
||||||
})));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
// only apply hydrate to option stores with an initial state in pinia
|
|
||||||
if (initialState &&
|
|
||||||
isOptionsStore &&
|
|
||||||
options.hydrate) {
|
|
||||||
options.hydrate(store.$state, initialState);
|
|
||||||
}
|
|
||||||
isListening = true;
|
|
||||||
isSyncListening = true;
|
|
||||||
return store;
|
|
||||||
}
|
|
||||||
// allows unused stores to be tree shaken
|
|
||||||
/*! #__NO_SIDE_EFFECTS__ */
|
|
||||||
function defineStore(
|
|
||||||
// TODO: add proper types from above
|
|
||||||
idOrOptions, setup, setupOptions) {
|
|
||||||
let id;
|
|
||||||
let options;
|
|
||||||
const isSetupStore = typeof setup === 'function';
|
|
||||||
if (typeof idOrOptions === 'string') {
|
|
||||||
id = idOrOptions;
|
|
||||||
// the option store setup will contain the actual options in this case
|
|
||||||
options = isSetupStore ? setupOptions : setup;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
options = idOrOptions;
|
|
||||||
id = idOrOptions.id;
|
|
||||||
}
|
|
||||||
function useStore(pinia, hot) {
|
|
||||||
const hasContext = vueDemi.hasInjectionContext();
|
|
||||||
pinia =
|
|
||||||
// in test mode, ignore the argument provided as we can always retrieve a
|
|
||||||
// pinia instance with getActivePinia()
|
|
||||||
((process.env.NODE_ENV === 'test') && activePinia && activePinia._testing ? null : pinia) ||
|
|
||||||
(hasContext ? vueDemi.inject(piniaSymbol, null) : null);
|
|
||||||
if (pinia)
|
|
||||||
setActivePinia(pinia);
|
|
||||||
pinia = activePinia;
|
|
||||||
if (!pinia._s.has(id)) {
|
|
||||||
// creating the store registers it in `pinia._s`
|
|
||||||
if (isSetupStore) {
|
|
||||||
createSetupStore(id, setup, options, pinia);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
createOptionsStore(id, options, pinia);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const store = pinia._s.get(id);
|
|
||||||
// StoreGeneric cannot be casted towards Store
|
|
||||||
return store;
|
|
||||||
}
|
|
||||||
useStore.$id = id;
|
|
||||||
return useStore;
|
|
||||||
}
|
|
||||||
|
|
||||||
let mapStoreSuffix = 'Store';
|
|
||||||
/**
|
|
||||||
* Changes the suffix added by `mapStores()`. Can be set to an empty string.
|
|
||||||
* Defaults to `"Store"`. Make sure to extend the MapStoresCustomization
|
|
||||||
* interface if you are using TypeScript.
|
|
||||||
*
|
|
||||||
* @param suffix - new suffix
|
|
||||||
*/
|
|
||||||
function setMapStoreSuffix(suffix // could be 'Store' but that would be annoying for JS
|
|
||||||
) {
|
|
||||||
mapStoreSuffix = suffix;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Allows using stores without the composition API (`setup()`) by generating an
|
|
||||||
* object to be spread in the `computed` field of a component. It accepts a list
|
|
||||||
* of store definitions.
|
|
||||||
*
|
|
||||||
* @example
|
|
||||||
* ```js
|
|
||||||
* export default {
|
|
||||||
* computed: {
|
|
||||||
* // other computed properties
|
|
||||||
* ...mapStores(useUserStore, useCartStore)
|
|
||||||
* },
|
|
||||||
*
|
|
||||||
* created() {
|
|
||||||
* this.userStore // store with id "user"
|
|
||||||
* this.cartStore // store with id "cart"
|
|
||||||
* }
|
|
||||||
* }
|
|
||||||
* ```
|
|
||||||
*
|
|
||||||
* @param stores - list of stores to map to an object
|
|
||||||
*/
|
|
||||||
function mapStores(...stores) {
|
|
||||||
return stores.reduce((reduced, useStore) => {
|
|
||||||
// @ts-expect-error: $id is added by defineStore
|
|
||||||
reduced[useStore.$id + mapStoreSuffix] = function () {
|
|
||||||
return useStore(this.$pinia);
|
|
||||||
};
|
|
||||||
return reduced;
|
|
||||||
}, {});
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Allows using state and getters from one store without using the composition
|
|
||||||
* API (`setup()`) by generating an object to be spread in the `computed` field
|
|
||||||
* of a component.
|
|
||||||
*
|
|
||||||
* @param useStore - store to map from
|
|
||||||
* @param keysOrMapper - array or object
|
|
||||||
*/
|
|
||||||
function mapState(useStore, keysOrMapper) {
|
|
||||||
return Array.isArray(keysOrMapper)
|
|
||||||
? keysOrMapper.reduce((reduced, key) => {
|
|
||||||
reduced[key] = function () {
|
|
||||||
// @ts-expect-error: FIXME: should work?
|
|
||||||
return useStore(this.$pinia)[key];
|
|
||||||
};
|
|
||||||
return reduced;
|
|
||||||
}, {})
|
|
||||||
: Object.keys(keysOrMapper).reduce((reduced, key) => {
|
|
||||||
// @ts-expect-error
|
|
||||||
reduced[key] = function () {
|
|
||||||
const store = useStore(this.$pinia);
|
|
||||||
const storeKey = keysOrMapper[key];
|
|
||||||
// for some reason TS is unable to infer the type of storeKey to be a
|
|
||||||
// function
|
|
||||||
return typeof storeKey === 'function'
|
|
||||||
? storeKey.call(this, store)
|
|
||||||
: // @ts-expect-error: FIXME: should work?
|
|
||||||
store[storeKey];
|
|
||||||
};
|
|
||||||
return reduced;
|
|
||||||
}, {});
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Alias for `mapState()`. You should use `mapState()` instead.
|
|
||||||
* @deprecated use `mapState()` instead.
|
|
||||||
*/
|
|
||||||
const mapGetters = mapState;
|
|
||||||
/**
|
|
||||||
* Allows directly using actions from your store without using the composition
|
|
||||||
* API (`setup()`) by generating an object to be spread in the `methods` field
|
|
||||||
* of a component.
|
|
||||||
*
|
|
||||||
* @param useStore - store to map from
|
|
||||||
* @param keysOrMapper - array or object
|
|
||||||
*/
|
|
||||||
function mapActions(useStore, keysOrMapper) {
|
|
||||||
return Array.isArray(keysOrMapper)
|
|
||||||
? keysOrMapper.reduce((reduced, key) => {
|
|
||||||
// @ts-expect-error
|
|
||||||
reduced[key] = function (...args) {
|
|
||||||
// @ts-expect-error: FIXME: should work?
|
|
||||||
return useStore(this.$pinia)[key](...args);
|
|
||||||
};
|
|
||||||
return reduced;
|
|
||||||
}, {})
|
|
||||||
: Object.keys(keysOrMapper).reduce((reduced, key) => {
|
|
||||||
// @ts-expect-error
|
|
||||||
reduced[key] = function (...args) {
|
|
||||||
// @ts-expect-error: FIXME: should work?
|
|
||||||
return useStore(this.$pinia)[keysOrMapper[key]](...args);
|
|
||||||
};
|
|
||||||
return reduced;
|
|
||||||
}, {});
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Allows using state and getters from one store without using the composition
|
|
||||||
* API (`setup()`) by generating an object to be spread in the `computed` field
|
|
||||||
* of a component.
|
|
||||||
*
|
|
||||||
* @param useStore - store to map from
|
|
||||||
* @param keysOrMapper - array or object
|
|
||||||
*/
|
|
||||||
function mapWritableState(useStore, keysOrMapper) {
|
|
||||||
return Array.isArray(keysOrMapper)
|
|
||||||
? keysOrMapper.reduce((reduced, key) => {
|
|
||||||
// @ts-ignore
|
|
||||||
reduced[key] = {
|
|
||||||
get() {
|
|
||||||
// @ts-expect-error: FIXME: should work?
|
|
||||||
return useStore(this.$pinia)[key];
|
|
||||||
},
|
|
||||||
set(value) {
|
|
||||||
// @ts-expect-error: FIXME: should work?
|
|
||||||
return (useStore(this.$pinia)[key] = value);
|
|
||||||
},
|
|
||||||
};
|
|
||||||
return reduced;
|
|
||||||
}, {})
|
|
||||||
: Object.keys(keysOrMapper).reduce((reduced, key) => {
|
|
||||||
// @ts-ignore
|
|
||||||
reduced[key] = {
|
|
||||||
get() {
|
|
||||||
// @ts-expect-error: FIXME: should work?
|
|
||||||
return useStore(this.$pinia)[keysOrMapper[key]];
|
|
||||||
},
|
|
||||||
set(value) {
|
|
||||||
// @ts-expect-error: FIXME: should work?
|
|
||||||
return (useStore(this.$pinia)[keysOrMapper[key]] = value);
|
|
||||||
},
|
|
||||||
};
|
|
||||||
return reduced;
|
|
||||||
}, {});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates an object of references with all the state, getters, and plugin-added
|
|
||||||
* state properties of the store. Similar to `toRefs()` but specifically
|
|
||||||
* designed for Pinia stores so methods and non reactive properties are
|
|
||||||
* completely ignored.
|
|
||||||
*
|
|
||||||
* @param store - store to extract the refs from
|
|
||||||
*/
|
|
||||||
function storeToRefs(store) {
|
|
||||||
// See https://github.com/vuejs/pinia/issues/852
|
|
||||||
// It's easier to just use toRefs() even if it includes more stuff
|
|
||||||
if (vueDemi.isVue2) {
|
|
||||||
// @ts-expect-error: toRefs include methods and others
|
|
||||||
return vueDemi.toRefs(store);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
const rawStore = vueDemi.toRaw(store);
|
|
||||||
const refs = {};
|
|
||||||
for (const key in rawStore) {
|
|
||||||
const value = rawStore[key];
|
|
||||||
if (vueDemi.isRef(value) || vueDemi.isReactive(value)) {
|
|
||||||
// @ts-expect-error: the key is state or getter
|
|
||||||
refs[key] =
|
|
||||||
// ---
|
|
||||||
vueDemi.toRef(store, key);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return refs;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Vue 2 Plugin that must be installed for pinia to work. Note **you don't need
|
|
||||||
* this plugin if you are using Nuxt.js**. Use the `buildModule` instead:
|
|
||||||
* https://pinia.vuejs.org/ssr/nuxt.html.
|
|
||||||
*
|
|
||||||
* @example
|
|
||||||
* ```js
|
|
||||||
* import Vue from 'vue'
|
|
||||||
* import { PiniaVuePlugin, createPinia } from 'pinia'
|
|
||||||
*
|
|
||||||
* Vue.use(PiniaVuePlugin)
|
|
||||||
* const pinia = createPinia()
|
|
||||||
*
|
|
||||||
* new Vue({
|
|
||||||
* el: '#app',
|
|
||||||
* // ...
|
|
||||||
* pinia,
|
|
||||||
* })
|
|
||||||
* ```
|
|
||||||
*
|
|
||||||
* @param _Vue - `Vue` imported from 'vue'.
|
|
||||||
*/
|
|
||||||
const PiniaVuePlugin = function (_Vue) {
|
|
||||||
// Equivalent of
|
|
||||||
// app.config.globalProperties.$pinia = pinia
|
|
||||||
_Vue.mixin({
|
|
||||||
beforeCreate() {
|
|
||||||
const options = this.$options;
|
|
||||||
if (options.pinia) {
|
|
||||||
const pinia = options.pinia;
|
|
||||||
// HACK: taken from provide(): https://github.com/vuejs/composition-api/blob/main/src/apis/inject.ts#L31
|
|
||||||
/* istanbul ignore else */
|
|
||||||
if (!this._provided) {
|
|
||||||
const provideCache = {};
|
|
||||||
Object.defineProperty(this, '_provided', {
|
|
||||||
get: () => provideCache,
|
|
||||||
set: (v) => Object.assign(provideCache, v),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
this._provided[piniaSymbol] = pinia;
|
|
||||||
// propagate the pinia instance in an SSR friendly way
|
|
||||||
// avoid adding it to nuxt twice
|
|
||||||
/* istanbul ignore else */
|
|
||||||
if (!this.$pinia) {
|
|
||||||
this.$pinia = pinia;
|
|
||||||
}
|
|
||||||
pinia._a = this;
|
|
||||||
if (IS_CLIENT) {
|
|
||||||
// this allows calling useStore() outside of a component setup after
|
|
||||||
// installing pinia's plugin
|
|
||||||
setActivePinia(pinia);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (!this.$pinia && options.parent && options.parent.$pinia) {
|
|
||||||
this.$pinia = options.parent.$pinia;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
destroyed() {
|
|
||||||
delete this._pStores;
|
|
||||||
},
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
exports.PiniaVuePlugin = PiniaVuePlugin;
|
|
||||||
exports.acceptHMRUpdate = acceptHMRUpdate;
|
|
||||||
exports.createPinia = createPinia;
|
|
||||||
exports.defineStore = defineStore;
|
|
||||||
exports.disposePinia = disposePinia;
|
|
||||||
exports.getActivePinia = getActivePinia;
|
|
||||||
exports.mapActions = mapActions;
|
|
||||||
exports.mapGetters = mapGetters;
|
|
||||||
exports.mapState = mapState;
|
|
||||||
exports.mapStores = mapStores;
|
|
||||||
exports.mapWritableState = mapWritableState;
|
|
||||||
exports.setActivePinia = setActivePinia;
|
|
||||||
exports.setMapStoreSuffix = setMapStoreSuffix;
|
|
||||||
exports.shouldHydrate = shouldHydrate;
|
|
||||||
exports.skipHydrate = skipHydrate;
|
|
||||||
exports.storeToRefs = storeToRefs;
|
|
7
node_modules/pinia/index.cjs
generated
vendored
7
node_modules/pinia/index.cjs
generated
vendored
|
@ -1,7 +0,0 @@
|
||||||
'use strict'
|
|
||||||
|
|
||||||
if (process.env.NODE_ENV === 'production') {
|
|
||||||
module.exports = require('./dist/pinia.prod.cjs')
|
|
||||||
} else {
|
|
||||||
module.exports = require('./dist/pinia.cjs')
|
|
||||||
}
|
|
7
node_modules/pinia/index.js
generated
vendored
7
node_modules/pinia/index.js
generated
vendored
|
@ -1,7 +0,0 @@
|
||||||
'use strict'
|
|
||||||
|
|
||||||
if (process.env.NODE_ENV === 'production') {
|
|
||||||
module.exports = require('./dist/pinia.prod.cjs')
|
|
||||||
} else {
|
|
||||||
module.exports = require('./dist/pinia.cjs')
|
|
||||||
}
|
|
126
node_modules/pinia/package.json
generated
vendored
126
node_modules/pinia/package.json
generated
vendored
|
@ -1,126 +0,0 @@
|
||||||
{
|
|
||||||
"_from": "pinia",
|
|
||||||
"_id": "pinia@2.2.5",
|
|
||||||
"_inBundle": false,
|
|
||||||
"_integrity": "sha512-T4PEQ4uFv2KIRC8A1Y3k1ceQGTDtxtd7nngYGu1IJUUSpuQoYfGq7w7rOc+f5YN1vx3mEs2NjjtN2IFbNS7jqA==",
|
|
||||||
"_location": "/pinia",
|
|
||||||
"_phantomChildren": {},
|
|
||||||
"_requested": {
|
|
||||||
"type": "tag",
|
|
||||||
"registry": true,
|
|
||||||
"raw": "pinia",
|
|
||||||
"name": "pinia",
|
|
||||||
"escapedName": "pinia",
|
|
||||||
"rawSpec": "",
|
|
||||||
"saveSpec": null,
|
|
||||||
"fetchSpec": "latest"
|
|
||||||
},
|
|
||||||
"_requiredBy": [
|
|
||||||
"#USER",
|
|
||||||
"/"
|
|
||||||
],
|
|
||||||
"_resolved": "https://registry.npmmirror.com/pinia/-/pinia-2.2.5.tgz",
|
|
||||||
"_shasum": "3269ff2cd67ae3dcc939334c0cf985f86c48b7a1",
|
|
||||||
"_spec": "pinia",
|
|
||||||
"_where": "D:\\FeiYi",
|
|
||||||
"author": {
|
|
||||||
"name": "Eduardo San Martin Morote",
|
|
||||||
"email": "posva13@gmail.com"
|
|
||||||
},
|
|
||||||
"bugs": {
|
|
||||||
"url": "https://github.com/vuejs/pinia/issues"
|
|
||||||
},
|
|
||||||
"bundleDependencies": false,
|
|
||||||
"dependencies": {
|
|
||||||
"@vue/devtools-api": "^6.6.3",
|
|
||||||
"vue-demi": "^0.14.10"
|
|
||||||
},
|
|
||||||
"deprecated": false,
|
|
||||||
"description": "Intuitive, type safe and flexible Store for Vue",
|
|
||||||
"devDependencies": {
|
|
||||||
"@microsoft/api-extractor": "7.47.9",
|
|
||||||
"@vue/test-utils": "^2.4.6"
|
|
||||||
},
|
|
||||||
"exports": {
|
|
||||||
".": {
|
|
||||||
"types": "./dist/pinia.d.ts",
|
|
||||||
"node": {
|
|
||||||
"import": {
|
|
||||||
"production": "./dist/pinia.prod.cjs",
|
|
||||||
"development": "./dist/pinia.mjs",
|
|
||||||
"default": "./dist/pinia.mjs"
|
|
||||||
},
|
|
||||||
"require": {
|
|
||||||
"production": "./dist/pinia.prod.cjs",
|
|
||||||
"development": "./dist/pinia.cjs",
|
|
||||||
"default": "./index.js"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"import": "./dist/pinia.mjs",
|
|
||||||
"require": "./index.js"
|
|
||||||
},
|
|
||||||
"./package.json": "./package.json",
|
|
||||||
"./dist/*": "./dist/*"
|
|
||||||
},
|
|
||||||
"files": [
|
|
||||||
"dist/*.js",
|
|
||||||
"dist/*.mjs",
|
|
||||||
"dist/*.cjs",
|
|
||||||
"dist/pinia.d.ts",
|
|
||||||
"index.js",
|
|
||||||
"index.cjs",
|
|
||||||
"LICENSE",
|
|
||||||
"README.md"
|
|
||||||
],
|
|
||||||
"funding": "https://github.com/sponsors/posva",
|
|
||||||
"homepage": "https://github.com/vuejs/pinia#readme",
|
|
||||||
"jsdelivr": "dist/pinia.iife.js",
|
|
||||||
"keywords": [
|
|
||||||
"vue",
|
|
||||||
"vuex",
|
|
||||||
"store",
|
|
||||||
"pinia",
|
|
||||||
"piña",
|
|
||||||
"pigna",
|
|
||||||
"composition",
|
|
||||||
"api",
|
|
||||||
"setup",
|
|
||||||
"typed",
|
|
||||||
"typescript",
|
|
||||||
"ts",
|
|
||||||
"type",
|
|
||||||
"safe"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
|
||||||
"main": "index.js",
|
|
||||||
"module": "dist/pinia.mjs",
|
|
||||||
"name": "pinia",
|
|
||||||
"peerDependencies": {
|
|
||||||
"@vue/composition-api": "^1.4.0",
|
|
||||||
"typescript": ">=4.4.4",
|
|
||||||
"vue": "^2.6.14 || ^3.5.11"
|
|
||||||
},
|
|
||||||
"peerDependenciesMeta": {
|
|
||||||
"typescript": {
|
|
||||||
"optional": true
|
|
||||||
},
|
|
||||||
"@vue/composition-api": {
|
|
||||||
"optional": true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "git+https://github.com/vuejs/pinia.git"
|
|
||||||
},
|
|
||||||
"scripts": {
|
|
||||||
"build": "rimraf dist && rollup -c ../../rollup.config.mjs --environment TARGET:pinia",
|
|
||||||
"build:dts": "api-extractor run --local --verbose && tail -n +3 ./src/globalExtensions.ts >> dist/pinia.d.ts",
|
|
||||||
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s --commit-path . -l pinia -r 1",
|
|
||||||
"test": "pnpm run build && pnpm run build:dts && pnpm test:dts",
|
|
||||||
"test:dts": "tsc -p ./test-dts/tsconfig.json"
|
|
||||||
},
|
|
||||||
"sideEffects": false,
|
|
||||||
"types": "dist/pinia.d.ts",
|
|
||||||
"unpkg": "dist/pinia.iife.js",
|
|
||||||
"version": "2.2.5"
|
|
||||||
}
|
|
21
node_modules/vue-demi/LICENSE
generated
vendored
21
node_modules/vue-demi/LICENSE
generated
vendored
|
@ -1,21 +0,0 @@
|
||||||
MIT License
|
|
||||||
|
|
||||||
Copyright (c) 2020-present, Anthony Fu
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
SOFTWARE.
|
|
229
node_modules/vue-demi/README.md
generated
vendored
229
node_modules/vue-demi/README.md
generated
vendored
|
@ -1,229 +0,0 @@
|
||||||
<p align="center">
|
|
||||||
<img src="https://github.com/vueuse/vue-demi/blob/main/assets/banner.png?raw=true" width="600"/>
|
|
||||||
<br>
|
|
||||||
<a href='https://www.npmjs.com/package/vue-demi'><img src='https://img.shields.io/npm/v/vue-demi?color=42b883' alt='npm'></a>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p align="center">
|
|
||||||
<b>Vue Demi</b> (<i>half</i> in French) is a developing utility<br> allows you to write <b>Universal Vue Libraries</b> for Vue 2 & 3<br>
|
|
||||||
<i>See more details in <a href='https://antfu.me/posts/make-libraries-working-with-vue-2-and-3'>this blog post</a></i>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<br>
|
|
||||||
|
|
||||||
<br>
|
|
||||||
|
|
||||||
## Strategies
|
|
||||||
|
|
||||||
- `<=2.6`: exports from `vue` + `@vue/composition-api` with plugin auto installing.
|
|
||||||
- `2.7`: exports from `vue` (Composition API is built-in in Vue 2.7).
|
|
||||||
- `>=3.0`: exports from `vue`, with polyfill of Vue 2's `set` and `del` API.
|
|
||||||
|
|
||||||
## Usage
|
|
||||||
|
|
||||||
Install this as your plugin's dependency:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
npm i vue-demi
|
|
||||||
# or
|
|
||||||
yarn add vue-demi
|
|
||||||
# or
|
|
||||||
pnpm i vue-demi
|
|
||||||
```
|
|
||||||
|
|
||||||
Add `vue` and `@vue/composition-api` to your plugin's peer dependencies to specify what versions you support.
|
|
||||||
|
|
||||||
```jsonc
|
|
||||||
{
|
|
||||||
"dependencies": {
|
|
||||||
"vue-demi": "latest"
|
|
||||||
},
|
|
||||||
"peerDependencies": {
|
|
||||||
"@vue/composition-api": "^1.0.0-rc.1",
|
|
||||||
"vue": "^2.0.0 || >=3.0.0"
|
|
||||||
},
|
|
||||||
"peerDependenciesMeta": {
|
|
||||||
"@vue/composition-api": {
|
|
||||||
"optional": true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"vue": "^3.0.0" // or "^2.6.0" base on your preferred working environment
|
|
||||||
},
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
Import everything related to Vue from it, it will redirect to `vue@2` + `@vue/composition-api` or `vue@3` based on users' environments.
|
|
||||||
|
|
||||||
```ts
|
|
||||||
import { ref, reactive, defineComponent } from 'vue-demi'
|
|
||||||
```
|
|
||||||
|
|
||||||
Publish your plugin and all is done!
|
|
||||||
|
|
||||||
> When using with [Vite](https://vitejs.dev), you will need to opt-out the pre-bundling to get `vue-demi` work properly by
|
|
||||||
> ```js
|
|
||||||
> // vite.config.js
|
|
||||||
> export default defineConfig({
|
|
||||||
> optimizeDeps: {
|
|
||||||
> exclude: ['vue-demi']
|
|
||||||
> }
|
|
||||||
> })
|
|
||||||
> ```
|
|
||||||
|
|
||||||
### Extra APIs
|
|
||||||
|
|
||||||
`Vue Demi` provides extra APIs to help distinguish users' environments and to do some version-specific logic.
|
|
||||||
|
|
||||||
### `isVue2` `isVue3`
|
|
||||||
|
|
||||||
```ts
|
|
||||||
import { isVue2, isVue3 } from 'vue-demi'
|
|
||||||
|
|
||||||
if (isVue2) {
|
|
||||||
// Vue 2 only
|
|
||||||
} else {
|
|
||||||
// Vue 3 only
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### `Vue2`
|
|
||||||
|
|
||||||
To avoid bringing in all the tree-shakable modules, we provide a `Vue2` export to support access to Vue 2's global API. (See [#41](https://github.com/vueuse/vue-demi/issues/41).)
|
|
||||||
|
|
||||||
```ts
|
|
||||||
import { Vue2 } from 'vue-demi'
|
|
||||||
|
|
||||||
if (Vue2) {
|
|
||||||
Vue2.config.ignoredElements.push('x-foo')
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### `install()`
|
|
||||||
|
|
||||||
Composition API in Vue 2 is provided as a plugin and needs to be installed on the Vue instance before using. Normally, `vue-demi` will try to install it automatically. For some usages where you might need to ensure the plugin gets installed correctly, the `install()` API is exposed to as a safe version of `Vue.use(CompositionAPI)`. `install()` in the Vue 3 environment will be an empty function (no-op).
|
|
||||||
|
|
||||||
```ts
|
|
||||||
import { install } from 'vue-demi'
|
|
||||||
|
|
||||||
install()
|
|
||||||
```
|
|
||||||
|
|
||||||
## CLI
|
|
||||||
|
|
||||||
### Manually Switch Versions
|
|
||||||
|
|
||||||
To explicitly switch the redirecting version, you can use these commands in your project's root.
|
|
||||||
|
|
||||||
```bash
|
|
||||||
npx vue-demi-switch 2
|
|
||||||
# or
|
|
||||||
npx vue-demi-switch 3
|
|
||||||
```
|
|
||||||
|
|
||||||
### Package Aliasing
|
|
||||||
|
|
||||||
If you would like to import `vue` under an alias, you can use the following command
|
|
||||||
|
|
||||||
```bash
|
|
||||||
npx vue-demi-switch 2 vue2
|
|
||||||
# or
|
|
||||||
npx vue-demi-switch 3 vue3
|
|
||||||
```
|
|
||||||
|
|
||||||
Then `vue-demi` will redirect APIs from the alias name you specified, for example:
|
|
||||||
|
|
||||||
```ts
|
|
||||||
import * as Vue from 'vue3'
|
|
||||||
|
|
||||||
var isVue2 = false
|
|
||||||
var isVue3 = true
|
|
||||||
var Vue2 = undefined
|
|
||||||
|
|
||||||
export * from 'vue3'
|
|
||||||
export {
|
|
||||||
Vue,
|
|
||||||
Vue2,
|
|
||||||
isVue2,
|
|
||||||
isVue3,
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### Auto Fix
|
|
||||||
|
|
||||||
If the `postinstall` hook doesn't get triggered or you have updated the Vue version, try to run the following command to resolve the redirecting.
|
|
||||||
|
|
||||||
```bash
|
|
||||||
npx vue-demi-fix
|
|
||||||
```
|
|
||||||
|
|
||||||
### Isomorphic Testings
|
|
||||||
|
|
||||||
You can support testing for both versions by adding npm alias in your dev dependencies. For example:
|
|
||||||
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"scripts": {
|
|
||||||
"test:2": "vue-demi-switch 2 vue2 && jest",
|
|
||||||
"test:3": "vue-demi-switch 3 && jest",
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"vue": "^3.0.0",
|
|
||||||
"vue2": "npm:vue@2"
|
|
||||||
},
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
or
|
|
||||||
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"scripts": {
|
|
||||||
"test:2": "vue-demi-switch 2 && jest",
|
|
||||||
"test:3": "vue-demi-switch 3 vue3 && jest",
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"vue": "^2.6.0",
|
|
||||||
"vue3": "npm:vue@3"
|
|
||||||
},
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
## Examples
|
|
||||||
|
|
||||||
See [examples](./examples).
|
|
||||||
|
|
||||||
## Who is using this?
|
|
||||||
|
|
||||||
- [VueUse](https://github.com/vueuse/vueuse) - Collection of Composition API utils
|
|
||||||
- [@vue/apollo-composable](https://github.com/vuejs/vue-apollo/tree/v4/packages/vue-apollo-composable) - Apollo GraphQL functions for Vue Composition API
|
|
||||||
- [vuelidate](https://github.com/vuelidate/vuelidate) - Simple, lightweight model-based validation
|
|
||||||
- [vue-composition-test-utils](https://github.com/ariesjia/vue-composition-test-utils) - Simple vue composition api unit test utilities
|
|
||||||
- [vue-use-stripe](https://github.com/frandiox/vue-use-stripe) - Stripe Elements wrapper for Vue.js
|
|
||||||
- [@opd/g2plot-vue](https://github.com/open-data-plan/g2plot-vue) - G2plot for vue
|
|
||||||
- [vue-echarts](https://github.com/ecomfe/vue-echarts) - Vue.js component for Apache ECharts.
|
|
||||||
- [fluent-vue](https://github.com/Demivan/fluent-vue) - Vue.js integration for [Fluent.js](https://github.com/projectfluent/fluent.js) - JavaScript implementation of [Project Fluent](https://projectfluent.org)
|
|
||||||
- [vue-datatable-url-sync](https://github.com/socotecio/vue-datatable-url-sync) - Synchronize datatable options and filters with the url to keep user preference even after refresh or navigation
|
|
||||||
- [vue-insta-stories](https://github.com/UnevenSoftware/vue-insta-stories) - Instagram stories in your vue projects.
|
|
||||||
- [vue-tiny-validate](https://github.com/FrontLabsOfficial/vue-tiny-validate) - Tiny Vue Validate Composition
|
|
||||||
- [v-perfect-signature](https://github.com/wobsoriano/v-perfect-signature) - Pressure-sensitive signature drawing for Vue 2 and 3
|
|
||||||
- [vue-winbox](https://github.com/wobsoriano/vue-winbox) - A wrapper component for WinBox.js that adds the ability to mount Vue components.
|
|
||||||
- [vue-word-highlighter](https://github.com/kawamataryo/vue-word-highlighter) - The word highlighter library for Vue 2 and Vue 3
|
|
||||||
- [vue-chart-3](https://github.com/victorgarciaesgi/vue-chart-3) - Vue.js component for Chart.js
|
|
||||||
- [json-editor-vue](https://github.com/cloydlau/json-editor-vue) - JSON editor & viewer for Vue 2 and 3.
|
|
||||||
- [kidar-echarts](https://github.com/kidarjs/kidar-echarts) - A simpler echarts component for Vue 2 and 3.
|
|
||||||
- [vue3-sketch-ruler](https://github.com/kakajun/vue3-sketch-ruler) - The zoom operation used for page presentation for Vue 2 and 3( Replace render function with template )
|
|
||||||
- [vue-rough-notation](https://github.com/Leecason/vue-rough-notation) - RoughNotation wrapper component for Vue 2 and 3.
|
|
||||||
- [vue-request](https://github.com/AttoJS/vue-request) - Vue composition API for data fetching, supports SWR, polling, error retry, cache request, pagination, etc.
|
|
||||||
- [vue3-lazyload](https://github.com/murongg/vue3-lazyload) - A vue3.x image lazyload plugin.
|
|
||||||
- [vue-codemirror6](https://github.com/logue/vue-codemirror6) - CodeMirror6 component for Vue2 and 3.
|
|
||||||
- [@tanstack/vue-query](https://github.com/TanStack/query) - TanStack Query for Vue.
|
|
||||||
> open a PR to add your library ;)
|
|
||||||
|
|
||||||
## Underhood
|
|
||||||
|
|
||||||
See [the blog post](https://antfu.me/posts/make-libraries-working-with-vue-2-and-3/#-introducing-vue-demi).
|
|
||||||
|
|
||||||
## License
|
|
||||||
|
|
||||||
MIT License © 2020 [Anthony Fu](https://github.com/antfu)
|
|
3
node_modules/vue-demi/bin/vue-demi-fix.js
generated
vendored
3
node_modules/vue-demi/bin/vue-demi-fix.js
generated
vendored
|
@ -1,3 +0,0 @@
|
||||||
#!/usr/bin/env node
|
|
||||||
'use strict'
|
|
||||||
require('../scripts/postinstall')
|
|
3
node_modules/vue-demi/bin/vue-demi-switch.js
generated
vendored
3
node_modules/vue-demi/bin/vue-demi-switch.js
generated
vendored
|
@ -1,3 +0,0 @@
|
||||||
#!/usr/bin/env node
|
|
||||||
'use strict'
|
|
||||||
require('../scripts/switch-cli')
|
|
29
node_modules/vue-demi/lib/index.cjs
generated
vendored
29
node_modules/vue-demi/lib/index.cjs
generated
vendored
|
@ -1,29 +0,0 @@
|
||||||
var Vue = require('vue')
|
|
||||||
|
|
||||||
Object.keys(Vue).forEach(function(key) {
|
|
||||||
exports[key] = Vue[key]
|
|
||||||
})
|
|
||||||
|
|
||||||
exports.set = function(target, key, val) {
|
|
||||||
if (Array.isArray(target)) {
|
|
||||||
target.length = Math.max(target.length, key)
|
|
||||||
target.splice(key, 1, val)
|
|
||||||
return val
|
|
||||||
}
|
|
||||||
target[key] = val
|
|
||||||
return val
|
|
||||||
}
|
|
||||||
|
|
||||||
exports.del = function(target, key) {
|
|
||||||
if (Array.isArray(target)) {
|
|
||||||
target.splice(key, 1)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
delete target[key]
|
|
||||||
}
|
|
||||||
|
|
||||||
exports.Vue = Vue
|
|
||||||
exports.Vue2 = undefined
|
|
||||||
exports.isVue2 = false
|
|
||||||
exports.isVue3 = true
|
|
||||||
exports.install = function(){}
|
|
22
node_modules/vue-demi/lib/index.d.ts
generated
vendored
22
node_modules/vue-demi/lib/index.d.ts
generated
vendored
|
@ -1,22 +0,0 @@
|
||||||
import * as Vue from 'vue'
|
|
||||||
declare const isVue2: boolean
|
|
||||||
declare const isVue3: boolean
|
|
||||||
declare const Vue2: any
|
|
||||||
declare const install: (vue?: any) => void
|
|
||||||
/**
|
|
||||||
* @deprecated To avoid bringing in all the tree-shakable modules, this API has been deprecated. Use `Vue2` or named exports instead.
|
|
||||||
* Refer to https://github.com/vueuse/vue-demi/issues/41
|
|
||||||
*/
|
|
||||||
declare const V: typeof Vue
|
|
||||||
|
|
||||||
export function set<T>(target: any, key: any, val: T): T
|
|
||||||
export function del(target: any, key: any): void
|
|
||||||
|
|
||||||
export * from 'vue'
|
|
||||||
export {
|
|
||||||
V as Vue,
|
|
||||||
Vue2,
|
|
||||||
isVue2,
|
|
||||||
isVue3,
|
|
||||||
install,
|
|
||||||
}
|
|
126
node_modules/vue-demi/lib/index.iife.js
generated
vendored
126
node_modules/vue-demi/lib/index.iife.js
generated
vendored
|
@ -1,126 +0,0 @@
|
||||||
var _VueDemiGlobal = typeof globalThis !== 'undefined'
|
|
||||||
? globalThis
|
|
||||||
: typeof global !== 'undefined'
|
|
||||||
? global
|
|
||||||
: typeof self !== 'undefined'
|
|
||||||
? self
|
|
||||||
: this
|
|
||||||
var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
|
|
||||||
if (VueDemi.install) {
|
|
||||||
return VueDemi
|
|
||||||
}
|
|
||||||
if (!Vue) {
|
|
||||||
console.error('[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`.')
|
|
||||||
return VueDemi
|
|
||||||
}
|
|
||||||
|
|
||||||
// Vue 2.7
|
|
||||||
if (Vue.version.slice(0, 4) === '2.7.') {
|
|
||||||
for (var key in Vue) {
|
|
||||||
VueDemi[key] = Vue[key]
|
|
||||||
}
|
|
||||||
VueDemi.isVue2 = true
|
|
||||||
VueDemi.isVue3 = false
|
|
||||||
VueDemi.install = function () {}
|
|
||||||
VueDemi.Vue = Vue
|
|
||||||
VueDemi.Vue2 = Vue
|
|
||||||
VueDemi.version = Vue.version
|
|
||||||
VueDemi.warn = Vue.util.warn
|
|
||||||
VueDemi.hasInjectionContext = function() {
|
|
||||||
return !!VueDemi.getCurrentInstance()
|
|
||||||
}
|
|
||||||
function createApp(rootComponent, rootProps) {
|
|
||||||
var vm
|
|
||||||
var provide = {}
|
|
||||||
var app = {
|
|
||||||
config: Vue.config,
|
|
||||||
use: Vue.use.bind(Vue),
|
|
||||||
mixin: Vue.mixin.bind(Vue),
|
|
||||||
component: Vue.component.bind(Vue),
|
|
||||||
provide: function (key, value) {
|
|
||||||
provide[key] = value
|
|
||||||
return this
|
|
||||||
},
|
|
||||||
directive: function (name, dir) {
|
|
||||||
if (dir) {
|
|
||||||
Vue.directive(name, dir)
|
|
||||||
return app
|
|
||||||
} else {
|
|
||||||
return Vue.directive(name)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mount: function (el, hydrating) {
|
|
||||||
if (!vm) {
|
|
||||||
vm = new Vue(Object.assign({ propsData: rootProps }, rootComponent, { provide: Object.assign(provide, rootComponent.provide) }))
|
|
||||||
vm.$mount(el, hydrating)
|
|
||||||
return vm
|
|
||||||
} else {
|
|
||||||
return vm
|
|
||||||
}
|
|
||||||
},
|
|
||||||
unmount: function () {
|
|
||||||
if (vm) {
|
|
||||||
vm.$destroy()
|
|
||||||
vm = undefined
|
|
||||||
}
|
|
||||||
},
|
|
||||||
}
|
|
||||||
return app
|
|
||||||
}
|
|
||||||
VueDemi.createApp = createApp
|
|
||||||
}
|
|
||||||
// Vue 2.6.x
|
|
||||||
else if (Vue.version.slice(0, 2) === '2.') {
|
|
||||||
if (VueCompositionAPI) {
|
|
||||||
for (var key in VueCompositionAPI) {
|
|
||||||
VueDemi[key] = VueCompositionAPI[key]
|
|
||||||
}
|
|
||||||
VueDemi.isVue2 = true
|
|
||||||
VueDemi.isVue3 = false
|
|
||||||
VueDemi.install = function () {}
|
|
||||||
VueDemi.Vue = Vue
|
|
||||||
VueDemi.Vue2 = Vue
|
|
||||||
VueDemi.version = Vue.version
|
|
||||||
VueDemi.hasInjectionContext = function() {
|
|
||||||
return !!VueDemi.getCurrentInstance()
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
console.error('[vue-demi] no VueCompositionAPI instance found, please be sure to import `@vue/composition-api` before `vue-demi`.')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Vue 3
|
|
||||||
else if (Vue.version.slice(0, 2) === '3.') {
|
|
||||||
for (var key in Vue) {
|
|
||||||
VueDemi[key] = Vue[key]
|
|
||||||
}
|
|
||||||
VueDemi.isVue2 = false
|
|
||||||
VueDemi.isVue3 = true
|
|
||||||
VueDemi.install = function () {}
|
|
||||||
VueDemi.Vue = Vue
|
|
||||||
VueDemi.Vue2 = undefined
|
|
||||||
VueDemi.version = Vue.version
|
|
||||||
VueDemi.set = function (target, key, val) {
|
|
||||||
if (Array.isArray(target)) {
|
|
||||||
target.length = Math.max(target.length, key)
|
|
||||||
target.splice(key, 1, val)
|
|
||||||
return val
|
|
||||||
}
|
|
||||||
target[key] = val
|
|
||||||
return val
|
|
||||||
}
|
|
||||||
VueDemi.del = function (target, key) {
|
|
||||||
if (Array.isArray(target)) {
|
|
||||||
target.splice(key, 1)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
delete target[key]
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
console.error('[vue-demi] Vue version ' + Vue.version + ' is unsupported.')
|
|
||||||
}
|
|
||||||
return VueDemi
|
|
||||||
})(
|
|
||||||
(_VueDemiGlobal.VueDemi = _VueDemiGlobal.VueDemi || (typeof VueDemi !== 'undefined' ? VueDemi : {})),
|
|
||||||
_VueDemiGlobal.Vue || (typeof Vue !== 'undefined' ? Vue : undefined),
|
|
||||||
_VueDemiGlobal.VueCompositionAPI || (typeof VueCompositionAPI !== 'undefined' ? VueCompositionAPI : undefined)
|
|
||||||
);
|
|
34
node_modules/vue-demi/lib/index.mjs
generated
vendored
34
node_modules/vue-demi/lib/index.mjs
generated
vendored
|
@ -1,34 +0,0 @@
|
||||||
import * as Vue from 'vue'
|
|
||||||
|
|
||||||
var isVue2 = false
|
|
||||||
var isVue3 = true
|
|
||||||
var Vue2 = undefined
|
|
||||||
|
|
||||||
function install() {}
|
|
||||||
|
|
||||||
export function set(target, key, val) {
|
|
||||||
if (Array.isArray(target)) {
|
|
||||||
target.length = Math.max(target.length, key)
|
|
||||||
target.splice(key, 1, val)
|
|
||||||
return val
|
|
||||||
}
|
|
||||||
target[key] = val
|
|
||||||
return val
|
|
||||||
}
|
|
||||||
|
|
||||||
export function del(target, key) {
|
|
||||||
if (Array.isArray(target)) {
|
|
||||||
target.splice(key, 1)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
delete target[key]
|
|
||||||
}
|
|
||||||
|
|
||||||
export * from 'vue'
|
|
||||||
export {
|
|
||||||
Vue,
|
|
||||||
Vue2,
|
|
||||||
isVue2,
|
|
||||||
isVue3,
|
|
||||||
install,
|
|
||||||
}
|
|
60
node_modules/vue-demi/lib/v2.7/index.cjs
generated
vendored
60
node_modules/vue-demi/lib/v2.7/index.cjs
generated
vendored
|
@ -1,60 +0,0 @@
|
||||||
var VueModule = require('vue')
|
|
||||||
|
|
||||||
// get the real Vue https://github.com/vueuse/vue-demi/issues/192
|
|
||||||
var Vue = VueModule.default || VueModule
|
|
||||||
|
|
||||||
exports.Vue = Vue
|
|
||||||
exports.Vue2 = Vue
|
|
||||||
exports.isVue2 = true
|
|
||||||
exports.isVue3 = false
|
|
||||||
exports.install = function () {}
|
|
||||||
exports.warn = Vue.util.warn
|
|
||||||
|
|
||||||
// createApp polyfill
|
|
||||||
exports.createApp = function (rootComponent, rootProps) {
|
|
||||||
var vm
|
|
||||||
var provide = {}
|
|
||||||
var app = {
|
|
||||||
config: Vue.config,
|
|
||||||
use: Vue.use.bind(Vue),
|
|
||||||
mixin: Vue.mixin.bind(Vue),
|
|
||||||
component: Vue.component.bind(Vue),
|
|
||||||
provide: function (key, value) {
|
|
||||||
provide[key] = value
|
|
||||||
return this
|
|
||||||
},
|
|
||||||
directive: function (name, dir) {
|
|
||||||
if (dir) {
|
|
||||||
Vue.directive(name, dir)
|
|
||||||
return app
|
|
||||||
} else {
|
|
||||||
return Vue.directive(name)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mount: function (el, hydrating) {
|
|
||||||
if (!vm) {
|
|
||||||
vm = new Vue(Object.assign({ propsData: rootProps }, rootComponent, { provide: Object.assign(provide, rootComponent.provide) }))
|
|
||||||
vm.$mount(el, hydrating)
|
|
||||||
return vm
|
|
||||||
} else {
|
|
||||||
return vm
|
|
||||||
}
|
|
||||||
},
|
|
||||||
unmount: function () {
|
|
||||||
if (vm) {
|
|
||||||
vm.$destroy()
|
|
||||||
vm = undefined
|
|
||||||
}
|
|
||||||
},
|
|
||||||
}
|
|
||||||
return app
|
|
||||||
}
|
|
||||||
|
|
||||||
Object.keys(VueModule).forEach(function (key) {
|
|
||||||
exports[key] = VueModule[key]
|
|
||||||
})
|
|
||||||
|
|
||||||
// Not implemented https://github.com/vuejs/core/pull/8111, falls back to getCurrentInstance()
|
|
||||||
exports.hasInjectionContext = function() {
|
|
||||||
return !!VueModule.getCurrentInstance()
|
|
||||||
}
|
|
38
node_modules/vue-demi/lib/v2.7/index.d.ts
generated
vendored
38
node_modules/vue-demi/lib/v2.7/index.d.ts
generated
vendored
|
@ -1,38 +0,0 @@
|
||||||
import Vue from 'vue'
|
|
||||||
import type { PluginFunction, PluginObject, VueConstructor, Directive, InjectionKey, Component } from 'vue'
|
|
||||||
|
|
||||||
declare const isVue2: boolean
|
|
||||||
declare const isVue3: boolean
|
|
||||||
declare const Vue2: typeof Vue | undefined
|
|
||||||
declare const version: string
|
|
||||||
declare const install: (vue?: typeof Vue) => void
|
|
||||||
export declare function warn(msg: string, vm?: Component | null): void
|
|
||||||
/**
|
|
||||||
* @deprecated To avoid bringing in all the tree-shakable modules, this API has been deprecated. Use `Vue2` or named exports instead.
|
|
||||||
* Refer to https://github.com/vueuse/vue-demi/issues/41
|
|
||||||
*/
|
|
||||||
declare const V: typeof Vue
|
|
||||||
|
|
||||||
// accept no generic because Vue 3 doesn't accept any
|
|
||||||
// https://github.com/vuejs/vue-next/pull/2758/
|
|
||||||
export declare type Plugin = PluginObject<any> | PluginFunction<any>
|
|
||||||
export type { VNode } from 'vue'
|
|
||||||
export * from 'vue'
|
|
||||||
export { V as Vue, Vue2, isVue2, isVue3, version, install }
|
|
||||||
|
|
||||||
// #region createApp polyfill
|
|
||||||
export interface App<T = any> {
|
|
||||||
config: VueConstructor['config']
|
|
||||||
use: VueConstructor['use']
|
|
||||||
mixin: VueConstructor['mixin']
|
|
||||||
component: VueConstructor['component']
|
|
||||||
directive(name: string): Directive | undefined
|
|
||||||
directive(name: string, directive: Directive): this
|
|
||||||
provide<T>(key: InjectionKey<T> | string, value: T): this
|
|
||||||
mount: Vue['$mount']
|
|
||||||
unmount: Vue['$destroy']
|
|
||||||
}
|
|
||||||
export declare function createApp(rootComponent: any, rootProps?: any): App
|
|
||||||
// #endregion
|
|
||||||
|
|
||||||
export declare function hasInjectionContext(): boolean
|
|
80
node_modules/vue-demi/lib/v2.7/index.mjs
generated
vendored
80
node_modules/vue-demi/lib/v2.7/index.mjs
generated
vendored
|
@ -1,80 +0,0 @@
|
||||||
import Vue from 'vue'
|
|
||||||
import { getCurrentInstance } from 'vue'
|
|
||||||
|
|
||||||
var isVue2 = true
|
|
||||||
var isVue3 = false
|
|
||||||
var Vue2 = Vue
|
|
||||||
var warn = Vue.util.warn
|
|
||||||
|
|
||||||
function install() {}
|
|
||||||
|
|
||||||
// createApp polyfill
|
|
||||||
export function createApp(rootComponent, rootProps) {
|
|
||||||
var vm
|
|
||||||
var provide = {}
|
|
||||||
var app = {
|
|
||||||
config: Vue.config,
|
|
||||||
use: Vue.use.bind(Vue),
|
|
||||||
mixin: Vue.mixin.bind(Vue),
|
|
||||||
component: Vue.component.bind(Vue),
|
|
||||||
provide: function (key, value) {
|
|
||||||
provide[key] = value
|
|
||||||
return this
|
|
||||||
},
|
|
||||||
directive: function (name, dir) {
|
|
||||||
if (dir) {
|
|
||||||
Vue.directive(name, dir)
|
|
||||||
return app
|
|
||||||
} else {
|
|
||||||
return Vue.directive(name)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mount: function (el, hydrating) {
|
|
||||||
if (!vm) {
|
|
||||||
vm = new Vue(Object.assign({ propsData: rootProps }, rootComponent, { provide: Object.assign(provide, rootComponent.provide) }))
|
|
||||||
vm.$mount(el, hydrating)
|
|
||||||
return vm
|
|
||||||
} else {
|
|
||||||
return vm
|
|
||||||
}
|
|
||||||
},
|
|
||||||
unmount: function () {
|
|
||||||
if (vm) {
|
|
||||||
vm.$destroy()
|
|
||||||
vm = undefined
|
|
||||||
}
|
|
||||||
},
|
|
||||||
}
|
|
||||||
return app
|
|
||||||
}
|
|
||||||
|
|
||||||
export {
|
|
||||||
Vue,
|
|
||||||
Vue2,
|
|
||||||
isVue2,
|
|
||||||
isVue3,
|
|
||||||
install,
|
|
||||||
warn
|
|
||||||
}
|
|
||||||
|
|
||||||
// Vue 3 components mock
|
|
||||||
function createMockComponent(name) {
|
|
||||||
return {
|
|
||||||
setup() {
|
|
||||||
throw new Error('[vue-demi] ' + name + ' is not supported in Vue 2. It\'s provided to avoid compiler errors.')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
export var Fragment = /*#__PURE__*/ createMockComponent('Fragment')
|
|
||||||
export var Transition = /*#__PURE__*/ createMockComponent('Transition')
|
|
||||||
export var TransitionGroup = /*#__PURE__*/ createMockComponent('TransitionGroup')
|
|
||||||
export var Teleport = /*#__PURE__*/ createMockComponent('Teleport')
|
|
||||||
export var Suspense = /*#__PURE__*/ createMockComponent('Suspense')
|
|
||||||
export var KeepAlive = /*#__PURE__*/ createMockComponent('KeepAlive')
|
|
||||||
|
|
||||||
export * from 'vue'
|
|
||||||
|
|
||||||
// Not implemented https://github.com/vuejs/core/pull/8111, falls back to getCurrentInstance()
|
|
||||||
export function hasInjectionContext() {
|
|
||||||
return !!getCurrentInstance()
|
|
||||||
}
|
|
34
node_modules/vue-demi/lib/v2/index.cjs
generated
vendored
34
node_modules/vue-demi/lib/v2/index.cjs
generated
vendored
|
@ -1,34 +0,0 @@
|
||||||
var Vue = require('vue')
|
|
||||||
var VueCompositionAPI = require('@vue/composition-api')
|
|
||||||
|
|
||||||
function install(_vue) {
|
|
||||||
var vueLib = _vue || Vue
|
|
||||||
if (vueLib && 'default' in vueLib) {
|
|
||||||
vueLib = vueLib.default
|
|
||||||
}
|
|
||||||
|
|
||||||
if (vueLib && !vueLib['__composition_api_installed__']) {
|
|
||||||
if (VueCompositionAPI && 'default' in VueCompositionAPI)
|
|
||||||
vueLib.use(VueCompositionAPI.default)
|
|
||||||
else if (VueCompositionAPI)
|
|
||||||
vueLib.use(VueCompositionAPI)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
install(Vue)
|
|
||||||
|
|
||||||
Object.keys(VueCompositionAPI).forEach(function(key) {
|
|
||||||
exports[key] = VueCompositionAPI[key]
|
|
||||||
})
|
|
||||||
|
|
||||||
exports.Vue = Vue
|
|
||||||
exports.Vue2 = Vue
|
|
||||||
exports.isVue2 = true
|
|
||||||
exports.isVue3 = false
|
|
||||||
exports.install = install
|
|
||||||
exports.version = Vue.version
|
|
||||||
|
|
||||||
// Not implemented https://github.com/vuejs/core/pull/8111, falls back to getCurrentInstance()
|
|
||||||
exports.hasInjectionContext = function () {
|
|
||||||
return !!VueCompositionAPI.getCurrentInstance()
|
|
||||||
}
|
|
33
node_modules/vue-demi/lib/v2/index.d.ts
generated
vendored
33
node_modules/vue-demi/lib/v2/index.d.ts
generated
vendored
|
@ -1,33 +0,0 @@
|
||||||
import Vue from 'vue'
|
|
||||||
import type { PluginFunction, PluginObject } from 'vue'
|
|
||||||
declare const isVue2: boolean
|
|
||||||
declare const isVue3: boolean
|
|
||||||
declare const Vue2: typeof Vue | undefined
|
|
||||||
declare const version: string
|
|
||||||
declare const install: (vue?: typeof Vue) => void
|
|
||||||
/**
|
|
||||||
* @deprecated To avoid bringing in all the tree-shakable modules, this API has been deprecated. Use `Vue2` or named exports instead.
|
|
||||||
* Refer to https://github.com/vueuse/vue-demi/issues/41
|
|
||||||
*/
|
|
||||||
declare const V: typeof Vue
|
|
||||||
|
|
||||||
/**
|
|
||||||
* DebuggerEvent is a Vue 3 development only feature. This type cannot exist in Vue 2.
|
|
||||||
*/
|
|
||||||
export declare type DebuggerEvent = never
|
|
||||||
|
|
||||||
// accept no generic because Vue 3 doesn't accept any
|
|
||||||
// https://github.com/vuejs/vue-next/pull/2758/
|
|
||||||
export declare type Plugin = PluginObject<any> | PluginFunction<any>
|
|
||||||
export type { VNode } from 'vue'
|
|
||||||
export * from '@vue/composition-api'
|
|
||||||
export {
|
|
||||||
V as Vue,
|
|
||||||
Vue2,
|
|
||||||
isVue2,
|
|
||||||
isVue3,
|
|
||||||
version,
|
|
||||||
install,
|
|
||||||
}
|
|
||||||
|
|
||||||
export declare function hasInjectionContext(): boolean
|
|
49
node_modules/vue-demi/lib/v2/index.mjs
generated
vendored
49
node_modules/vue-demi/lib/v2/index.mjs
generated
vendored
|
@ -1,49 +0,0 @@
|
||||||
import Vue from 'vue'
|
|
||||||
import VueCompositionAPI, { getCurrentInstance } from '@vue/composition-api/dist/vue-composition-api.mjs'
|
|
||||||
|
|
||||||
function install(_vue) {
|
|
||||||
_vue = _vue || Vue
|
|
||||||
if (_vue && !_vue['__composition_api_installed__'])
|
|
||||||
_vue.use(VueCompositionAPI)
|
|
||||||
}
|
|
||||||
|
|
||||||
install(Vue)
|
|
||||||
|
|
||||||
var isVue2 = true
|
|
||||||
var isVue3 = false
|
|
||||||
var Vue2 = Vue
|
|
||||||
var version = Vue.version
|
|
||||||
|
|
||||||
/**VCA-EXPORTS**/
|
|
||||||
export * from '@vue/composition-api/dist/vue-composition-api.mjs'
|
|
||||||
/**VCA-EXPORTS**/
|
|
||||||
|
|
||||||
export {
|
|
||||||
Vue,
|
|
||||||
Vue2,
|
|
||||||
isVue2,
|
|
||||||
isVue3,
|
|
||||||
version,
|
|
||||||
install,
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Vue 3 components mock
|
|
||||||
function createMockComponent(name) {
|
|
||||||
return {
|
|
||||||
setup() {
|
|
||||||
throw new Error('[vue-demi] ' + name + ' is not supported in Vue 2. It\'s provided to avoid compiler errors.')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
export var Fragment = /*#__PURE__*/ createMockComponent('Fragment')
|
|
||||||
export var Transition = /*#__PURE__*/ createMockComponent('Transition')
|
|
||||||
export var TransitionGroup = /*#__PURE__*/ createMockComponent('TransitionGroup')
|
|
||||||
export var Teleport = /*#__PURE__*/ createMockComponent('Teleport')
|
|
||||||
export var Suspense = /*#__PURE__*/ createMockComponent('Suspense')
|
|
||||||
export var KeepAlive = /*#__PURE__*/ createMockComponent('KeepAlive')
|
|
||||||
|
|
||||||
// Not implemented https://github.com/vuejs/core/pull/8111, falls back to getCurrentInstance()
|
|
||||||
export function hasInjectionContext() {
|
|
||||||
return !!getCurrentInstance()
|
|
||||||
}
|
|
29
node_modules/vue-demi/lib/v3/index.cjs
generated
vendored
29
node_modules/vue-demi/lib/v3/index.cjs
generated
vendored
|
@ -1,29 +0,0 @@
|
||||||
var Vue = require('vue')
|
|
||||||
|
|
||||||
Object.keys(Vue).forEach(function(key) {
|
|
||||||
exports[key] = Vue[key]
|
|
||||||
})
|
|
||||||
|
|
||||||
exports.set = function(target, key, val) {
|
|
||||||
if (Array.isArray(target)) {
|
|
||||||
target.length = Math.max(target.length, key)
|
|
||||||
target.splice(key, 1, val)
|
|
||||||
return val
|
|
||||||
}
|
|
||||||
target[key] = val
|
|
||||||
return val
|
|
||||||
}
|
|
||||||
|
|
||||||
exports.del = function(target, key) {
|
|
||||||
if (Array.isArray(target)) {
|
|
||||||
target.splice(key, 1)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
delete target[key]
|
|
||||||
}
|
|
||||||
|
|
||||||
exports.Vue = Vue
|
|
||||||
exports.Vue2 = undefined
|
|
||||||
exports.isVue2 = false
|
|
||||||
exports.isVue3 = true
|
|
||||||
exports.install = function(){}
|
|
22
node_modules/vue-demi/lib/v3/index.d.ts
generated
vendored
22
node_modules/vue-demi/lib/v3/index.d.ts
generated
vendored
|
@ -1,22 +0,0 @@
|
||||||
import * as Vue from 'vue'
|
|
||||||
declare const isVue2: boolean
|
|
||||||
declare const isVue3: boolean
|
|
||||||
declare const Vue2: any
|
|
||||||
declare const install: (vue?: any) => void
|
|
||||||
/**
|
|
||||||
* @deprecated To avoid bringing in all the tree-shakable modules, this API has been deprecated. Use `Vue2` or named exports instead.
|
|
||||||
* Refer to https://github.com/vueuse/vue-demi/issues/41
|
|
||||||
*/
|
|
||||||
declare const V: typeof Vue
|
|
||||||
|
|
||||||
export function set<T>(target: any, key: any, val: T): T
|
|
||||||
export function del(target: any, key: any): void
|
|
||||||
|
|
||||||
export * from 'vue'
|
|
||||||
export {
|
|
||||||
V as Vue,
|
|
||||||
Vue2,
|
|
||||||
isVue2,
|
|
||||||
isVue3,
|
|
||||||
install,
|
|
||||||
}
|
|
34
node_modules/vue-demi/lib/v3/index.mjs
generated
vendored
34
node_modules/vue-demi/lib/v3/index.mjs
generated
vendored
|
@ -1,34 +0,0 @@
|
||||||
import * as Vue from 'vue'
|
|
||||||
|
|
||||||
var isVue2 = false
|
|
||||||
var isVue3 = true
|
|
||||||
var Vue2 = undefined
|
|
||||||
|
|
||||||
function install() {}
|
|
||||||
|
|
||||||
export function set(target, key, val) {
|
|
||||||
if (Array.isArray(target)) {
|
|
||||||
target.length = Math.max(target.length, key)
|
|
||||||
target.splice(key, 1, val)
|
|
||||||
return val
|
|
||||||
}
|
|
||||||
target[key] = val
|
|
||||||
return val
|
|
||||||
}
|
|
||||||
|
|
||||||
export function del(target, key) {
|
|
||||||
if (Array.isArray(target)) {
|
|
||||||
target.splice(key, 1)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
delete target[key]
|
|
||||||
}
|
|
||||||
|
|
||||||
export * from 'vue'
|
|
||||||
export {
|
|
||||||
Vue,
|
|
||||||
Vue2,
|
|
||||||
isVue2,
|
|
||||||
isVue3,
|
|
||||||
install,
|
|
||||||
}
|
|
83
node_modules/vue-demi/package.json
generated
vendored
83
node_modules/vue-demi/package.json
generated
vendored
|
@ -1,83 +0,0 @@
|
||||||
{
|
|
||||||
"_from": "vue-demi@^0.14.10",
|
|
||||||
"_id": "vue-demi@0.14.10",
|
|
||||||
"_inBundle": false,
|
|
||||||
"_integrity": "sha512-nMZBOwuzabUO0nLgIcc6rycZEebF6eeUfaiQx9+WSk8e29IbLvPU9feI6tqW4kTo3hvoYAJkMh8n8D0fuISphg==",
|
|
||||||
"_location": "/vue-demi",
|
|
||||||
"_phantomChildren": {},
|
|
||||||
"_requested": {
|
|
||||||
"type": "range",
|
|
||||||
"registry": true,
|
|
||||||
"raw": "vue-demi@^0.14.10",
|
|
||||||
"name": "vue-demi",
|
|
||||||
"escapedName": "vue-demi",
|
|
||||||
"rawSpec": "^0.14.10",
|
|
||||||
"saveSpec": null,
|
|
||||||
"fetchSpec": "^0.14.10"
|
|
||||||
},
|
|
||||||
"_requiredBy": [
|
|
||||||
"/pinia"
|
|
||||||
],
|
|
||||||
"_resolved": "https://registry.npmmirror.com/vue-demi/-/vue-demi-0.14.10.tgz",
|
|
||||||
"_shasum": "afc78de3d6f9e11bf78c55e8510ee12814522f04",
|
|
||||||
"_spec": "vue-demi@^0.14.10",
|
|
||||||
"_where": "D:\\FeiYi\\node_modules\\pinia",
|
|
||||||
"author": {
|
|
||||||
"name": "Anthony Fu",
|
|
||||||
"email": "anthonyfu117@hotmail.com"
|
|
||||||
},
|
|
||||||
"bin": {
|
|
||||||
"vue-demi-fix": "bin/vue-demi-fix.js",
|
|
||||||
"vue-demi-switch": "bin/vue-demi-switch.js"
|
|
||||||
},
|
|
||||||
"bugs": {
|
|
||||||
"url": "https://github.com/antfu/vue-demi/issues"
|
|
||||||
},
|
|
||||||
"bundleDependencies": false,
|
|
||||||
"deprecated": false,
|
|
||||||
"description": "<p align=\"center\"> <img src=\"https://github.com/vueuse/vue-demi/blob/main/assets/banner.png?raw=true\" width=\"600\"/> <br> <a href='https://www.npmjs.com/package/vue-demi'><img src='https://img.shields.io/npm/v/vue-demi?color=42b883' alt='npm'></a> </p>",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=12"
|
|
||||||
},
|
|
||||||
"exports": {
|
|
||||||
".": {
|
|
||||||
"types": "./lib/index.d.ts",
|
|
||||||
"require": "./lib/index.cjs",
|
|
||||||
"import": "./lib/index.mjs",
|
|
||||||
"browser": "./lib/index.mjs"
|
|
||||||
},
|
|
||||||
"./*": "./*"
|
|
||||||
},
|
|
||||||
"files": [
|
|
||||||
"lib",
|
|
||||||
"bin",
|
|
||||||
"scripts"
|
|
||||||
],
|
|
||||||
"funding": "https://github.com/sponsors/antfu",
|
|
||||||
"homepage": "https://github.com/antfu/vue-demi#readme",
|
|
||||||
"jsdelivr": "lib/index.iife.js",
|
|
||||||
"license": "MIT",
|
|
||||||
"main": "lib/index.cjs",
|
|
||||||
"module": "lib/index.mjs",
|
|
||||||
"name": "vue-demi",
|
|
||||||
"peerDependencies": {
|
|
||||||
"@vue/composition-api": "^1.0.0-rc.1",
|
|
||||||
"vue": "^3.0.0-0 || ^2.6.0"
|
|
||||||
},
|
|
||||||
"peerDependenciesMeta": {
|
|
||||||
"@vue/composition-api": {
|
|
||||||
"optional": true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "git+https://github.com/antfu/vue-demi.git"
|
|
||||||
},
|
|
||||||
"scripts": {
|
|
||||||
"postinstall": "node -e \"try{require('./scripts/postinstall.js')}catch(e){}\"",
|
|
||||||
"release": "npx bumpp --tag --commit --push && npm publish"
|
|
||||||
},
|
|
||||||
"types": "lib/index.d.ts",
|
|
||||||
"unpkg": "lib/index.iife.js",
|
|
||||||
"version": "0.14.10"
|
|
||||||
}
|
|
19
node_modules/vue-demi/scripts/postinstall.js
generated
vendored
19
node_modules/vue-demi/scripts/postinstall.js
generated
vendored
|
@ -1,19 +0,0 @@
|
||||||
const { switchVersion, loadModule } = require('./utils')
|
|
||||||
|
|
||||||
const Vue = loadModule('vue')
|
|
||||||
|
|
||||||
if (!Vue || typeof Vue.version !== 'string') {
|
|
||||||
console.warn('[vue-demi] Vue is not found. Please run "npm install vue" to install.')
|
|
||||||
}
|
|
||||||
else if (Vue.version.startsWith('2.7.')) {
|
|
||||||
switchVersion(2.7)
|
|
||||||
}
|
|
||||||
else if (Vue.version.startsWith('2.')) {
|
|
||||||
switchVersion(2)
|
|
||||||
}
|
|
||||||
else if (Vue.version.startsWith('3.')) {
|
|
||||||
switchVersion(3)
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
console.warn(`[vue-demi] Vue version v${Vue.version} is not supported.`)
|
|
||||||
}
|
|
18
node_modules/vue-demi/scripts/switch-cli.js
generated
vendored
18
node_modules/vue-demi/scripts/switch-cli.js
generated
vendored
|
@ -1,18 +0,0 @@
|
||||||
const { switchVersion } = require('./utils')
|
|
||||||
|
|
||||||
const version = process.argv[2]
|
|
||||||
const vueEntry = process.argv[3] || 'vue'
|
|
||||||
|
|
||||||
if (version === '2.7') {
|
|
||||||
switchVersion(2.7, vueEntry)
|
|
||||||
console.log(`[vue-demi] Switched for Vue 2.7 (entry: "${vueEntry}")`)
|
|
||||||
} else if (version === '2') {
|
|
||||||
switchVersion(2, vueEntry)
|
|
||||||
console.log(`[vue-demi] Switched for Vue 2 (entry: "${vueEntry}")`)
|
|
||||||
} else if (version === '3') {
|
|
||||||
switchVersion(3, vueEntry)
|
|
||||||
console.log(`[vue-demi] Switched for Vue 3 (entry: "${vueEntry}")`)
|
|
||||||
} else {
|
|
||||||
console.warn(`[vue-demi] expecting version "2" or "2.7" or "3" but got "${version}"`)
|
|
||||||
process.exit(1)
|
|
||||||
}
|
|
62
node_modules/vue-demi/scripts/utils.js
generated
vendored
62
node_modules/vue-demi/scripts/utils.js
generated
vendored
|
@ -1,62 +0,0 @@
|
||||||
const fs = require('fs')
|
|
||||||
const path = require('path')
|
|
||||||
|
|
||||||
const dir = path.resolve(__dirname, '..', 'lib')
|
|
||||||
|
|
||||||
function loadModule(name) {
|
|
||||||
try {
|
|
||||||
return require(name)
|
|
||||||
} catch (e) {
|
|
||||||
return undefined
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function copy(name, version, vue) {
|
|
||||||
vue = vue || 'vue'
|
|
||||||
const src = path.join(dir, `v${version}`, name)
|
|
||||||
const dest = path.join(dir, name)
|
|
||||||
let content = fs.readFileSync(src, 'utf-8')
|
|
||||||
content = content.replace(/'vue'/g, `'${vue}'`)
|
|
||||||
// unlink for pnpm, #92
|
|
||||||
try {
|
|
||||||
fs.unlinkSync(dest)
|
|
||||||
} catch (error) { }
|
|
||||||
fs.writeFileSync(dest, content, 'utf-8')
|
|
||||||
}
|
|
||||||
|
|
||||||
function updateVue2API() {
|
|
||||||
const ignoreList = ['version', 'default']
|
|
||||||
const VCA = loadModule('@vue/composition-api')
|
|
||||||
if (!VCA) {
|
|
||||||
console.warn('[vue-demi] Composition API plugin is not found. Please run "npm install @vue/composition-api" to install.')
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
const exports = Object.keys(VCA).filter(i => !ignoreList.includes(i))
|
|
||||||
|
|
||||||
const esmPath = path.join(dir, 'index.mjs')
|
|
||||||
let content = fs.readFileSync(esmPath, 'utf-8')
|
|
||||||
|
|
||||||
content = content.replace(
|
|
||||||
/\/\*\*VCA-EXPORTS\*\*\/[\s\S]+\/\*\*VCA-EXPORTS\*\*\//m,
|
|
||||||
`/**VCA-EXPORTS**/
|
|
||||||
export { ${exports.join(', ')} } from '@vue/composition-api/dist/vue-composition-api.mjs'
|
|
||||||
/**VCA-EXPORTS**/`
|
|
||||||
)
|
|
||||||
|
|
||||||
fs.writeFileSync(esmPath, content, 'utf-8')
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
function switchVersion(version, vue) {
|
|
||||||
copy('index.cjs', version, vue)
|
|
||||||
copy('index.mjs', version, vue)
|
|
||||||
copy('index.d.ts', version, vue)
|
|
||||||
|
|
||||||
if (version === 2)
|
|
||||||
updateVue2API()
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
module.exports.loadModule = loadModule
|
|
||||||
module.exports.switchVersion = switchVersion
|
|
31
package-lock.json
generated
31
package-lock.json
generated
|
@ -1,30 +1,17 @@
|
||||||
{
|
{
|
||||||
|
"name": "jiangchengfeiyi-xiaochengxu",
|
||||||
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"lockfileVersion": 1,
|
"packages": {
|
||||||
|
"": {
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@vue/devtools-api": {
|
"mitt": "^3.0.1"
|
||||||
"version": "6.6.4",
|
|
||||||
"resolved": "https://registry.npmmirror.com/@vue/devtools-api/-/devtools-api-6.6.4.tgz",
|
|
||||||
"integrity": "sha512-sGhTPMuXqZ1rVOk32RylztWkfXTRhuS7vgAKv0zjqk8gbsHkJ7xfFf+jbySxt7tWObEJwyKaHMikV/WGDiQm8g=="
|
|
||||||
},
|
|
||||||
"mitt": {
|
|
||||||
"version": "3.0.1",
|
|
||||||
"resolved": "https://registry.npmmirror.com/mitt/-/mitt-3.0.1.tgz",
|
|
||||||
"integrity": "sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw=="
|
|
||||||
},
|
|
||||||
"pinia": {
|
|
||||||
"version": "2.2.5",
|
|
||||||
"resolved": "https://registry.npmmirror.com/pinia/-/pinia-2.2.5.tgz",
|
|
||||||
"integrity": "sha512-T4PEQ4uFv2KIRC8A1Y3k1ceQGTDtxtd7nngYGu1IJUUSpuQoYfGq7w7rOc+f5YN1vx3mEs2NjjtN2IFbNS7jqA==",
|
|
||||||
"requires": {
|
|
||||||
"@vue/devtools-api": "^6.6.3",
|
|
||||||
"vue-demi": "^0.14.10"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"vue-demi": {
|
"node_modules/mitt": {
|
||||||
"version": "0.14.10",
|
"version": "3.0.1",
|
||||||
"resolved": "https://registry.npmmirror.com/vue-demi/-/vue-demi-0.14.10.tgz",
|
"resolved": "https://registry.npmjs.org/mitt/-/mitt-3.0.1.tgz",
|
||||||
"integrity": "sha512-nMZBOwuzabUO0nLgIcc6rycZEebF6eeUfaiQx9+WSk8e29IbLvPU9feI6tqW4kTo3hvoYAJkMh8n8D0fuISphg=="
|
"integrity": "sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw=="
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
5
package.json
Normal file
5
package.json
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
"dependencies": {
|
||||||
|
"mitt": "^3.0.1"
|
||||||
|
}
|
||||||
|
}
|
14
pages.json
14
pages.json
|
@ -175,6 +175,20 @@
|
||||||
{
|
{
|
||||||
"navigationBarTitleText" : ""
|
"navigationBarTitleText" : ""
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path" : "pages/booking/CostumeDisplay/CostumeDisplay",
|
||||||
|
"style" :
|
||||||
|
{
|
||||||
|
"navigationBarTitleText" : ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path" : "pages/booking/CostumeDetails/CostumeDetails",
|
||||||
|
"style" :
|
||||||
|
{
|
||||||
|
"navigationBarTitleText" : ""
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"globalStyle": {
|
"globalStyle": {
|
||||||
|
|
46
pages/booking/CostumeDetails/CostumeDetails.vue
Normal file
46
pages/booking/CostumeDetails/CostumeDetails.vue
Normal file
|
@ -0,0 +1,46 @@
|
||||||
|
<template>
|
||||||
|
<view>{{details.name}}</view>
|
||||||
|
<image :src="details.image"></image>
|
||||||
|
<image :src="details.effectImg"></image>
|
||||||
|
<view>{{details.intro}}</view>
|
||||||
|
<view>{{details.price}}</view>
|
||||||
|
<view>{{details.clothesType}}</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import {ref,onMounted} from 'vue'
|
||||||
|
import { onLoad } from '@dcloudio/uni-app'
|
||||||
|
import { baseUrl } from '../../../api/request';
|
||||||
|
const id = ref([{}])
|
||||||
|
const details = ref([{}])
|
||||||
|
onLoad((options)=>{
|
||||||
|
id.value = JSON.parse(options.info)
|
||||||
|
console.log(id.value,1111111111)
|
||||||
|
})
|
||||||
|
onMounted(()=>{
|
||||||
|
getDetails()
|
||||||
|
})
|
||||||
|
const getDetails = async ()=>{
|
||||||
|
const res = await uni.request({
|
||||||
|
url:baseUrl + '/clothesInfo/list/detail',
|
||||||
|
method:'POST',
|
||||||
|
header:{
|
||||||
|
cookie:wx.getAccountInfoSync('cookie')
|
||||||
|
},
|
||||||
|
data:{
|
||||||
|
id:id.value
|
||||||
|
}
|
||||||
|
})
|
||||||
|
if(res.data.code === 1){
|
||||||
|
details.value = res.data.data
|
||||||
|
}else{
|
||||||
|
uin.showtoast({
|
||||||
|
icon:'error',
|
||||||
|
title:'获取失败'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
</style>
|
223
pages/booking/CostumeDisplay/CostumeDisplay.vue
Normal file
223
pages/booking/CostumeDisplay/CostumeDisplay.vue
Normal file
|
@ -0,0 +1,223 @@
|
||||||
|
<template>
|
||||||
|
<!-- <view v-for="(item,index) in label" >
|
||||||
|
<view>{{item.name}}</view>
|
||||||
|
<image :src="item.image"></image>
|
||||||
|
<view>{{item.intro}}</view>
|
||||||
|
<view>{{item.price}}</view>
|
||||||
|
</view> -->
|
||||||
|
<view class="flex-col page">
|
||||||
|
<view class="flex-col section">
|
||||||
|
<text class="self-start text">服装展示</text>
|
||||||
|
<view class="flex-col self-stretch mt-21">
|
||||||
|
<view class="flex-row items-center mt-10 list-item" v-for="(item, index) in label" :key="index" @click="goToText(index)">
|
||||||
|
<image
|
||||||
|
class="shrink-0 image_2"
|
||||||
|
:src="item.image"
|
||||||
|
/>
|
||||||
|
<view class="flex-col flex-1 ml-11">
|
||||||
|
<view class="flex-col self-stretch">
|
||||||
|
<view class="flex-row justify-end self-stretch group">
|
||||||
|
<text class="font">详细信息</text>
|
||||||
|
<image
|
||||||
|
class="image"
|
||||||
|
:src="item.image"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
<text class="self-start font_2 text_2 mt-3">{{item.name}}</text>
|
||||||
|
</view>
|
||||||
|
<view class="self-stretch group_2 mt-5">
|
||||||
|
<text class="font_4">服装简介:</text>
|
||||||
|
<text class="font_3">
|
||||||
|
{{item.intro}}
|
||||||
|
</text>
|
||||||
|
</view>
|
||||||
|
<text class="self-end font_5 mt-5">¥{{item.price}}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="mt-48 flex-row items-center section_2">
|
||||||
|
<view class="flex-col items-center shrink-0 section_3">
|
||||||
|
<image
|
||||||
|
class="image_3"
|
||||||
|
src="https://ide.code.fun/api/image?token=674eb236797f850011f0c44a&name=4b56fed14a39630ca2312edf6e34c024.png"
|
||||||
|
/>
|
||||||
|
<text class="mt-2 text_4">客服</text>
|
||||||
|
</view>
|
||||||
|
<view class="ml-34 flex-col justify-start items-center flex-1 text-wrapper">
|
||||||
|
<text class="text_3">现在去预约</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { ref,onMounted } from 'vue'
|
||||||
|
import { onLoad } from '@dcloudio/uni-app'
|
||||||
|
import { baseUrl } from '../../../api/request';
|
||||||
|
const list = ref([{}])
|
||||||
|
const label = ref([{}])
|
||||||
|
onMounted(()=>{
|
||||||
|
getLabel()
|
||||||
|
})
|
||||||
|
onLoad((options)=>{
|
||||||
|
list.value = JSON.parse(options.info)
|
||||||
|
console.log(list.value,'id')
|
||||||
|
})
|
||||||
|
const getLabel = async ()=>{
|
||||||
|
const res = await uni.request({
|
||||||
|
url:baseUrl + '/clothesInfo/list/label',
|
||||||
|
method:'POST',
|
||||||
|
header:{
|
||||||
|
cookie:wx.getAccountInfoSync('cookie')
|
||||||
|
},
|
||||||
|
data:{
|
||||||
|
id:list.value
|
||||||
|
}
|
||||||
|
})
|
||||||
|
console.log(res)
|
||||||
|
if(res.data.code === 1){
|
||||||
|
label.value = res.data.data
|
||||||
|
}else{
|
||||||
|
uin.showtoast({
|
||||||
|
icon:'error',
|
||||||
|
title:'获取失败'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const goToText = (index)=>{
|
||||||
|
uni.navigateTo({
|
||||||
|
url:"/pages/booking/CostumeDetails/CostumeDetails?info=" + JSON.stringify(label.value[index].id)
|
||||||
|
})
|
||||||
|
console.log(label.value[index].id)
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.mt-21 {
|
||||||
|
margin-top: 39.38rpx;
|
||||||
|
}
|
||||||
|
.ml-11 {
|
||||||
|
margin-left: 20.63rpx;
|
||||||
|
}
|
||||||
|
.mt-3 {
|
||||||
|
margin-top: 5.63rpx;
|
||||||
|
}
|
||||||
|
.mt-5 {
|
||||||
|
margin-top: 9.38rpx;
|
||||||
|
}
|
||||||
|
.page {
|
||||||
|
padding-top: 69.38rpx;
|
||||||
|
background-color: #f5f5dc;
|
||||||
|
width: 100%;
|
||||||
|
overflow-y: auto;
|
||||||
|
overflow-x: hidden;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
.section {
|
||||||
|
margin: 0 18.75rpx;
|
||||||
|
padding: 37.5rpx 30rpx 129.38rpx;
|
||||||
|
background-color: #fffef8;
|
||||||
|
border-radius: 18.75rpx;
|
||||||
|
}
|
||||||
|
.text {
|
||||||
|
color: #000000;
|
||||||
|
font-size: 30rpx;
|
||||||
|
font-family: Open Sans;
|
||||||
|
line-height: 27.71rpx;
|
||||||
|
}
|
||||||
|
.list-item {
|
||||||
|
padding: 22.5rpx 22.5rpx 22.5rpx 30rpx;
|
||||||
|
background-color: #fff3c3;
|
||||||
|
border-radius: 9.38rpx;
|
||||||
|
}
|
||||||
|
.list-item:first-child {
|
||||||
|
margin-top: 0;
|
||||||
|
}
|
||||||
|
.image_2 {
|
||||||
|
border-radius: 9.38rpx;
|
||||||
|
width: 148.13rpx;
|
||||||
|
height: 165rpx;
|
||||||
|
}
|
||||||
|
.group {
|
||||||
|
padding: 0 3.75rpx;
|
||||||
|
}
|
||||||
|
.font {
|
||||||
|
font-size: 18.75rpx;
|
||||||
|
font-family: Open Sans;
|
||||||
|
line-height: 17.44rpx;
|
||||||
|
color: #323232;
|
||||||
|
}
|
||||||
|
.image {
|
||||||
|
width: 15rpx;
|
||||||
|
height: 15rpx;
|
||||||
|
}
|
||||||
|
.font_2 {
|
||||||
|
font-size: 26.25rpx;
|
||||||
|
font-family: Open Sans;
|
||||||
|
line-height: 22.5rpx;
|
||||||
|
color: #323232;
|
||||||
|
}
|
||||||
|
.text_2 {
|
||||||
|
line-height: 24.26rpx;
|
||||||
|
}
|
||||||
|
.group_2 {
|
||||||
|
line-height: 22.5rpx;
|
||||||
|
}
|
||||||
|
.font_4 {
|
||||||
|
font-size: 18.75rpx;
|
||||||
|
font-family: Open Sans;
|
||||||
|
line-height: 22.5rpx;
|
||||||
|
color: #323232;
|
||||||
|
}
|
||||||
|
.font_3 {
|
||||||
|
font-size: 18.75rpx;
|
||||||
|
font-family: Open Sans;
|
||||||
|
line-height: 22.5rpx;
|
||||||
|
color: #828282;
|
||||||
|
}
|
||||||
|
.font_5 {
|
||||||
|
font-size: 33.75rpx;
|
||||||
|
font-family: Times New Roman;
|
||||||
|
line-height: 24.73rpx;
|
||||||
|
color: #ff3c3c;
|
||||||
|
}
|
||||||
|
.section_2 {
|
||||||
|
background-color: #fffef8;
|
||||||
|
position: fixed;
|
||||||
|
bottom: 0;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.section_3 {
|
||||||
|
padding: 15rpx 0;
|
||||||
|
background-color: #ffc470;
|
||||||
|
width: 118.13rpx;
|
||||||
|
height: 114.38rpx;
|
||||||
|
}
|
||||||
|
.image_3 {
|
||||||
|
width: 52.5rpx;
|
||||||
|
height: 52.5rpx;
|
||||||
|
}
|
||||||
|
.text_4 {
|
||||||
|
color: #fffef8;
|
||||||
|
font-size: 26.25rpx;
|
||||||
|
font-family: Inter;
|
||||||
|
line-height: 24.17rpx;
|
||||||
|
}
|
||||||
|
.text-wrapper {
|
||||||
|
margin-right: 26.25rpx;
|
||||||
|
padding: 26.25rpx 0;
|
||||||
|
background-color: #fbb612;
|
||||||
|
border-radius: 75rpx;
|
||||||
|
height: 82.5rpx;
|
||||||
|
}
|
||||||
|
.text_3 {
|
||||||
|
color: #ffffff;
|
||||||
|
font-size: 30rpx;
|
||||||
|
font-family: Inter;
|
||||||
|
line-height: 27.86rpx;
|
||||||
|
}
|
||||||
|
@import url("../../../common/css/global.css");
|
||||||
|
</style>
|
|
@ -90,14 +90,14 @@
|
||||||
<view class="flex-col group_5">
|
<view class="flex-col group_5">
|
||||||
<text class="self-start font text_6">选择服装价位</text>
|
<text class="self-start font text_6">选择服装价位</text>
|
||||||
<view class="flex-row items-center self-stretch section_8 view" v-for="(item,index) in Whole" :key="item" @click="goToText(index)" >
|
<view class="flex-row items-center self-stretch section_8 view" v-for="(item,index) in Whole" :key="item" @click="goToText(index)" >
|
||||||
<image :src="item.img" class="shrink-0 image_4"></image>
|
<image :src="item.image" class="shrink-0 image_4"></image>
|
||||||
<view class="flex-col flex-1 ml-13">
|
<view class="flex-col flex-1 ml-13">
|
||||||
<view class="self-start font_2 text_7">{{item.name}}</view>
|
<view class="self-start font_2 text_7">{{item.clothesType}}</view>
|
||||||
<view class="flex-row items-baseline self-stretch mt-11">
|
<view class="flex-row items-baseline self-stretch mt-11">
|
||||||
<text class="font_2">价位:</text>
|
<text class="font_2">价位:</text>
|
||||||
<view class="font_6 text_8 ml-1">¥{{item.price}}</view>
|
<view class="font_6 text_8 ml-1">¥{{item.minPrice}}-{{item.maxPrice}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="self-stretch font_7 text_9 mt-11">{{item.title}}</view>
|
<view class="self-stretch font_7 text_9 mt-11">{{item.brief}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex-row shrink-0 ml-21">
|
<view class="flex-row shrink-0 ml-21">
|
||||||
<view class="flex-col justify-start items-center button"><text class="font_5">选择</text></view>
|
<view class="flex-col justify-start items-center button"><text class="font_5">选择</text></view>
|
||||||
|
@ -111,18 +111,17 @@
|
||||||
<view class="flex-col">
|
<view class="flex-col">
|
||||||
<text class="self-start font text_15">选择拍摄场景</text>
|
<text class="self-start font text_15">选择拍摄场景</text>
|
||||||
<view class="flex-row self-stretch mt-15">
|
<view class="flex-row self-stretch mt-15">
|
||||||
<view class="flex-row justify-center items-center section_9">
|
<radio-group class="flex-row justify-center items-center section_9" @change="handleLocationChange">
|
||||||
<image class="image_7"
|
<image class="image_7"
|
||||||
src="https://carbon2.obs.cn-north-4.myhuaweicloud.com:443/feiyi%2Ftest%2F0%2FDSCeqARd-shinei.png" />
|
src="https://carbon2.obs.cn-north-4.myhuaweicloud.com:443/feiyi%2Ftest%2F0%2FDSCeqARd-shinei.png" />
|
||||||
<text class="ml-16 font_8 text_16">室内</text>
|
<text class="ml-16 font_8 text_16">室内</text>
|
||||||
<checkbox class="ml-16" name="location" value="室内"></checkbox>
|
<radio name="location" value="室内"></radio>
|
||||||
</view>
|
|
||||||
<view class="flex-row justify-center items-center section_9 ml-23">
|
|
||||||
<image class="image_7"
|
<image class="image_7"
|
||||||
|
style="margin-left: 20px"
|
||||||
src="https://carbon2.obs.cn-north-4.myhuaweicloud.com:443/feiyi%2Ftest%2F0%2FgfjDWgWY-shiwai.png" />
|
src="https://carbon2.obs.cn-north-4.myhuaweicloud.com:443/feiyi%2Ftest%2F0%2FgfjDWgWY-shiwai.png" />
|
||||||
<text class="ml-16 font_8 text_17">室外</text>
|
<text class="ml-16 font_8 text_17">室外</text>
|
||||||
<checkbox class="ml-16" name="location" value="室外"></checkbox>
|
<radio name="location" value="室外"></radio>
|
||||||
</view>
|
</radio-group>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="mt-26 flex-row justify-center items-center" @click="openPopup1">
|
<view class="mt-26 flex-row justify-center items-center" @click="openPopup1">
|
||||||
|
@ -158,18 +157,17 @@
|
||||||
<view class="flex-col">
|
<view class="flex-col">
|
||||||
<text class="self-start font text_15">选择拍摄场景</text>
|
<text class="self-start font text_15">选择拍摄场景</text>
|
||||||
<view class="flex-row self-stretch mt-15">
|
<view class="flex-row self-stretch mt-15">
|
||||||
<view class="flex-row justify-center items-center section_9">
|
<radio-group class="flex-row justify-center items-center section_9" @change="handleLocationChange">
|
||||||
<image class="image_7"
|
<image class="image_7"
|
||||||
src="https://carbon2.obs.cn-north-4.myhuaweicloud.com:443/feiyi%2Ftest%2F0%2FDSCeqARd-shinei.png" />
|
src="https://carbon2.obs.cn-north-4.myhuaweicloud.com:443/feiyi%2Ftest%2F0%2FDSCeqARd-shinei.png" />
|
||||||
<text class="ml-16 font_8 text_16">室内</text>
|
<text class="ml-16 font_8 text_16">室内</text>
|
||||||
<checkbox class="ml-16" name="location" value="室内"></checkbox>
|
<radio name="location" value="室内"></radio>
|
||||||
</view>
|
|
||||||
<view class="flex-row justify-center items-center section_9 ml-23">
|
|
||||||
<image class="image_7"
|
<image class="image_7"
|
||||||
|
style="margin-left: 20px"
|
||||||
src="https://carbon2.obs.cn-north-4.myhuaweicloud.com:443/feiyi%2Ftest%2F0%2FgfjDWgWY-shiwai.png" />
|
src="https://carbon2.obs.cn-north-4.myhuaweicloud.com:443/feiyi%2Ftest%2F0%2FgfjDWgWY-shiwai.png" />
|
||||||
<text class="ml-16 font_8 text_17">室外</text>
|
<text class="ml-16 font_8 text_17">室外</text>
|
||||||
<checkbox class="ml-16" name="location" value="室外"></checkbox>
|
<radio name="location" value="室外"></radio>
|
||||||
</view>
|
</radio-group>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex-row self-stretch section_12">
|
<view class="flex-row self-stretch section_12">
|
||||||
|
@ -217,30 +215,36 @@
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import {
|
import {
|
||||||
ref
|
ref,onMounted
|
||||||
} from 'vue';
|
} from 'vue'
|
||||||
|
import { baseUrl } from '@/api/request'
|
||||||
|
|
||||||
|
onMounted(()=>{
|
||||||
|
getWhole()
|
||||||
|
})
|
||||||
const displayItem = ref([])
|
const displayItem = ref([])
|
||||||
const Whole = ref([
|
const Whole = ref([{}])
|
||||||
{
|
const getWhole = async()=>{
|
||||||
img: 'https://carbon2.obs.cn-north-4.myhuaweicloud.com:443/feiyi%2Ftest%2F0%2FFQDXFHYB-000-2.png',
|
const res = await uni.request({
|
||||||
name: '简约风尚',
|
url: baseUrl + '/clothesGrade/list',
|
||||||
price: '100-200',
|
method:'POST',
|
||||||
title: '传承非遗之美,简约演绎经典',
|
header:{
|
||||||
|
cookie:wx.getAccountInfoSync('cookie')
|
||||||
},
|
},
|
||||||
{
|
data:{
|
||||||
img: 'https://carbon2.obs.cn-north-4.myhuaweicloud.com:443/feiyi%2Ftest%2F0%2FdTSYNsqi-000-3.png',
|
|
||||||
name: '时尚精选',
|
|
||||||
price: '200-400',
|
|
||||||
title: '融合时尚与传统,精选非遗划账',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
img: ' https://carbon2.obs.cn-north-4.myhuaweicloud.com:443/feiyi%2Ftest%2F0%2FDSCaeopg-000-1.png',
|
|
||||||
name: '奢华专属',
|
|
||||||
price: '400-800',
|
|
||||||
title: '非遗匠心独运,奢华专属定制',
|
|
||||||
}
|
}
|
||||||
])
|
})
|
||||||
const Own = ref([{
|
if(res.data.code === 1){
|
||||||
|
Whole.value=res.data.data
|
||||||
|
}else{
|
||||||
|
uin.showtoast({
|
||||||
|
icon:'error',
|
||||||
|
title:'获取失败'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const Own = ref([{
|
||||||
img: 'https://carbon2.obs.cn-north-4.myhuaweicloud.com:443/feiyi%2Ftest%2F0%2FObQGBPnJ-zhuangfa.png',
|
img: 'https://carbon2.obs.cn-north-4.myhuaweicloud.com:443/feiyi%2Ftest%2F0%2FObQGBPnJ-zhuangfa.png',
|
||||||
name: '妆发预约',
|
name: '妆发预约',
|
||||||
price: '20',
|
price: '20',
|
||||||
|
@ -257,12 +261,12 @@ const zhi = ref('0')
|
||||||
|
|
||||||
const showWhole = (zhiValue) => {
|
const showWhole = (zhiValue) => {
|
||||||
zhi.value = zhiValue
|
zhi.value = zhiValue
|
||||||
console.log(zhi.value)
|
// console.log(zhi.value)
|
||||||
}
|
}
|
||||||
|
|
||||||
const showOwn = (zhiValue) => {
|
const showOwn = (zhiValue) => {
|
||||||
zhi.value = zhiValue
|
zhi.value = zhiValue
|
||||||
console.log(zhi.value)
|
// console.log(zhi.value)
|
||||||
}
|
}
|
||||||
|
|
||||||
const close1 = () => {
|
const close1 = () => {
|
||||||
|
@ -298,19 +302,23 @@ const selectedLocation = ref(null)
|
||||||
const handleFormSubmit = () => {
|
const handleFormSubmit = () => {
|
||||||
selectedLocation.value = null
|
selectedLocation.value = null
|
||||||
}
|
}
|
||||||
const goToText = (index) =>{
|
//室内室外
|
||||||
console.log(index);
|
const handleLocationChange = (e) => {
|
||||||
|
selectedLocation.value = e.detail.value
|
||||||
|
console.log( selectedLocation.value)
|
||||||
|
}
|
||||||
|
const goToText = (index) => {
|
||||||
|
console.log(index)
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url:"/pages/booking/CostumeDisplay/CostumeDisplay?info="
|
url: "/pages/booking/CostumeDisplay/CostumeDisplay?info=" + JSON.stringify(Whole.value[index].id)
|
||||||
+ JSON.stringify(Whole.value[index])
|
});
|
||||||
})
|
console.log(Whole.value[index].id)
|
||||||
}
|
}
|
||||||
const goToContact = ()=>{
|
const goToContact = ()=>{
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url:'/pages/mine/Contact/Contact'
|
url:'/pages/mine/Contact/Contact'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
console.log(Whole.value[1])
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
298
pages/mine/Contact/Contact.vue
Normal file
298
pages/mine/Contact/Contact.vue
Normal file
|
@ -0,0 +1,298 @@
|
||||||
|
<template>
|
||||||
|
<uni-popup ref="popup" :mask-click="false" background-color="white">
|
||||||
|
<input placeholder="联系人姓名" v-model="newContact.name" />
|
||||||
|
<input placeholder="联系方式" v-model="newContact.phone" />
|
||||||
|
<button @click="addContact">保存</button>
|
||||||
|
<button @click="close">取消</button>
|
||||||
|
</uni-popup>
|
||||||
|
<uni-popup ref="popup1" :mask-click="false" background-color="white">
|
||||||
|
<input placeholder="联系人姓名" v-model="newContact.name" />
|
||||||
|
<input placeholder="联系方式" v-model="newContact.phone" />
|
||||||
|
<button @click="saveModifiedContact">保存</button>
|
||||||
|
<button @click="close1">取消</button>
|
||||||
|
</uni-popup>
|
||||||
|
<view class="flex-col page">
|
||||||
|
<view class="flex-col">
|
||||||
|
<view class="flex-row justify-center items-center relative group">
|
||||||
|
<text class="text">联系人信息</text>
|
||||||
|
<image class="image pos"
|
||||||
|
src="https://ide.code.fun/api/image?token=673329a3c471750012deb1ec&name=888e11f2c452b3d64f79a5136a779376.png" />
|
||||||
|
</view>
|
||||||
|
<view class="mt-16 flex-col">
|
||||||
|
<view class="flex-row justify-between items-center list-item mt-5"
|
||||||
|
v-for="(item, index) in filteredContacts" :key="index">
|
||||||
|
<view class="flex-row items-center">
|
||||||
|
<text class="font ml-9">{{item.name}}</text>
|
||||||
|
<text class="font_2 ml-9">{{item.phone}} -{{item.id}}</text>
|
||||||
|
</view>
|
||||||
|
<view class="flex-row group_2">
|
||||||
|
<image class="image_2"
|
||||||
|
src="https://carbon2.obs.cn-north-4.myhuaweicloud.com:443/feiyi%2Ftest%2F0%2FEclWfXMx-bj.png"
|
||||||
|
@click="editContact(item,index)" />
|
||||||
|
<image class="ml-12 image_2"
|
||||||
|
src="https://carbon2.obs.cn-north-4.myhuaweicloud.com:443/feiyi%2Ftest%2F0%2FzgFMedLP-sc.png"
|
||||||
|
@click="deleteContact(item,index)" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="flex-col justify-start items-center section mt-431" @click="open">
|
||||||
|
<view class="flex-col justify-start items-center text-wrapper"><text class="text_2">添加新联系人</text></view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import {
|
||||||
|
ref,
|
||||||
|
onMounted,
|
||||||
|
watch,
|
||||||
|
set
|
||||||
|
} from 'vue';
|
||||||
|
import {
|
||||||
|
baseUrl
|
||||||
|
} from '../../../api/request';
|
||||||
|
onMounted(() => {
|
||||||
|
getContacts()
|
||||||
|
})
|
||||||
|
const contacts = ref([{}])
|
||||||
|
//获取联系人列表
|
||||||
|
const getContacts = async () => {
|
||||||
|
const res = await uni.request({
|
||||||
|
url: baseUrl + '/contacts/list',
|
||||||
|
method: 'POST',
|
||||||
|
header: {
|
||||||
|
cookie : wx.getStorageSync('cookie')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
console.log(res)
|
||||||
|
if (res.data.code === 1) {
|
||||||
|
filteredContacts.value = res.data.data
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
icon: 'error',
|
||||||
|
title: '获取失败'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
const newContact = ref({
|
||||||
|
ame: '',
|
||||||
|
phone: '',
|
||||||
|
isDefault:0
|
||||||
|
})
|
||||||
|
|
||||||
|
const searchText = ref('')
|
||||||
|
const filteredContacts = ref([])
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
filteredContacts.value = contacts.value
|
||||||
|
})
|
||||||
|
|
||||||
|
watch(searchText, () => {
|
||||||
|
if (searchText.value === '') {
|
||||||
|
filteredContacts.value = contacts.value;
|
||||||
|
} else {
|
||||||
|
filteredContacts.value = contacts.value.filter(contact => {
|
||||||
|
return contact.name.includes(searchText.value) || contact.phone.includes(
|
||||||
|
searchText.value);
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
//添加联系人
|
||||||
|
const addContact = async ()=> {
|
||||||
|
popup.value.close()
|
||||||
|
const res = await uni.request({
|
||||||
|
url:baseUrl + '/contacts/add',
|
||||||
|
method:'POST',
|
||||||
|
header: {
|
||||||
|
cookie : wx.getStorageSync('cookie')
|
||||||
|
},
|
||||||
|
data:{
|
||||||
|
name:newContact.value.name,
|
||||||
|
phone:newContact.value.phone,
|
||||||
|
isDefault:0
|
||||||
|
}})
|
||||||
|
console.log(res,添加)
|
||||||
|
if (res.data.code === 1){
|
||||||
|
console.log('添加成功')
|
||||||
|
}else{
|
||||||
|
uni.showToast({
|
||||||
|
icon: 'error',
|
||||||
|
title: '添加失败'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
getContacts()
|
||||||
|
}
|
||||||
|
//删除联系人
|
||||||
|
const deleteContact = async(item,index) => {
|
||||||
|
const res = await uni.request({
|
||||||
|
url:baseUrl + '/contacts/delete',
|
||||||
|
method:'POST',
|
||||||
|
header: {
|
||||||
|
cookie : wx.getStorageSync('cookie')
|
||||||
|
},
|
||||||
|
data:{
|
||||||
|
id:item.value[index].id,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
console.log(item.value[index].id)
|
||||||
|
console.log(res,'1111111111111')
|
||||||
|
if(res.data.code === 1){
|
||||||
|
console.log('删除成功')
|
||||||
|
}else{
|
||||||
|
uni.showToast({
|
||||||
|
icon: 'error',
|
||||||
|
title: '删除失败'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
getContacts()
|
||||||
|
}
|
||||||
|
const indexToModify = ref(null)
|
||||||
|
const editContact = (index) => {
|
||||||
|
popup1.value.open('center')
|
||||||
|
indexToModify.value = index
|
||||||
|
const contactToModify = contacts.value[index]
|
||||||
|
newContact.value = {
|
||||||
|
name: contactToModify.name,
|
||||||
|
phone: contactToModify.phone
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const saveModifiedContact = () => {
|
||||||
|
if (indexToModify.value !== null) {
|
||||||
|
const Index = indexToModify.value
|
||||||
|
const contact = contacts.value[Index]
|
||||||
|
contact.name = newContact.value.name;
|
||||||
|
contact.phone = newContact.value.phone;
|
||||||
|
newContact.value = {
|
||||||
|
name: '',
|
||||||
|
phone: ''
|
||||||
|
}
|
||||||
|
popup1.value.close()
|
||||||
|
filteredContacts.value = contacts.value
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const popup = ref(null)
|
||||||
|
const popup1 = ref(null)
|
||||||
|
const open = () => {
|
||||||
|
popup.value.open('center')
|
||||||
|
}
|
||||||
|
const open1 = () => {
|
||||||
|
popup1.value.open('center')
|
||||||
|
}
|
||||||
|
const close = () => {
|
||||||
|
popup.value.close();
|
||||||
|
}
|
||||||
|
const close1 = () => {
|
||||||
|
popup1.value.close();
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.mt-5 {
|
||||||
|
margin-top: 9.38rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ml-9 {
|
||||||
|
margin-left: 16.88rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mt-431 {
|
||||||
|
margin-top: 808.13rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page {
|
||||||
|
padding-top: 18.75rpx;
|
||||||
|
background-color: #f5f5dc;
|
||||||
|
border-radius: 28.13rpx 28.13rpx 0rpx 0rpx;
|
||||||
|
width: 100%;
|
||||||
|
overflow-y: auto;
|
||||||
|
overflow-x: hidden;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.group {
|
||||||
|
padding: 11.25rpx 24.38rpx 7.5rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text {
|
||||||
|
color: #323232;
|
||||||
|
font-size: 37.5rpx;
|
||||||
|
font-family: Open Sans;
|
||||||
|
line-height: 35.21rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image {
|
||||||
|
width: 52.5rpx;
|
||||||
|
height: 52.5rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pos {
|
||||||
|
position: absolute;
|
||||||
|
right: 24.38rpx;
|
||||||
|
top: 50%;
|
||||||
|
transform: translateY(-50%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.list-item {
|
||||||
|
padding: 52.5rpx 15rpx;
|
||||||
|
background-color: #fffef8;
|
||||||
|
border-bottom: solid 1.88rpx #c8c8c8;
|
||||||
|
}
|
||||||
|
|
||||||
|
.list-item:first-child {
|
||||||
|
margin-top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image_3 {
|
||||||
|
width: 33.75rpx;
|
||||||
|
height: 33.75rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.font {
|
||||||
|
font-size: 30rpx;
|
||||||
|
font-family: Open Sans;
|
||||||
|
line-height: 27.19rpx;
|
||||||
|
color: #323232;
|
||||||
|
}
|
||||||
|
|
||||||
|
.font_2 {
|
||||||
|
font-size: 30rpx;
|
||||||
|
font-family: Open Sans;
|
||||||
|
line-height: 22.05rpx;
|
||||||
|
color: #323232;
|
||||||
|
}
|
||||||
|
|
||||||
|
.group_2 {
|
||||||
|
margin-right: 11.25rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image_2 {
|
||||||
|
width: 39.38rpx;
|
||||||
|
height: 39.38rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.section {
|
||||||
|
margin-left: 16.88rpx;
|
||||||
|
padding: 22.5rpx 0 15rpx;
|
||||||
|
background-color: #fffef8;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-wrapper {
|
||||||
|
padding: 30rpx 0;
|
||||||
|
background-color: #fbb612;
|
||||||
|
border-radius: 75rpx;
|
||||||
|
width: 639.38rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text_2 {
|
||||||
|
color: #ffffff;
|
||||||
|
font-size: 33.75rpx;
|
||||||
|
font-family: Open Sans;
|
||||||
|
line-height: 31.22rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
@import url(/common/css/global.css)
|
||||||
|
</style>
|
261
pages/mine/bookings/booking.vue
Normal file
261
pages/mine/bookings/booking.vue
Normal file
|
@ -0,0 +1,261 @@
|
||||||
|
<template>
|
||||||
|
<view class="flex-col page">
|
||||||
|
<view class="flex-col section">
|
||||||
|
<view class="flex-row justify-between self-stretch group">
|
||||||
|
<text class="font text">待消费</text>
|
||||||
|
<text class="font text_2" @click="goto()">已消费</text>
|
||||||
|
</view>
|
||||||
|
<view class="self-start section_2"></view>
|
||||||
|
</view>
|
||||||
|
<view class="flex-col section_3 mt-13" v-for="i in item">
|
||||||
|
<text class="self-end font_2 text_3">待消费</text>
|
||||||
|
<view class="flex-row items-baseline self-stretch group_2">
|
||||||
|
<text class="font_3 text_4">订单编号:</text>
|
||||||
|
<text class="font_3 text_5 ml-5">E20241005095840091406189</text>
|
||||||
|
</view>
|
||||||
|
<view class="flex-row self-stretch group_3">
|
||||||
|
<image class="shrink-0 image"
|
||||||
|
src="https://ide.code.fun/api/image?token=6736eddfc471750012df05d6&name=bc0e955304da0a2ccafe3a66ac1f3aca.png" />
|
||||||
|
<view class="flex-col flex-1 group_4">
|
||||||
|
<view class="flex-row justify-center self-stretch relative">
|
||||||
|
<text class="font_2 text_6 pos">整套约拍</text>
|
||||||
|
<text class="font_2 text_7">【时尚精选】</text>
|
||||||
|
</view>
|
||||||
|
<text class="self-start font_5 text_10">到店日期:2024-10-15</text>
|
||||||
|
<text class="self-start font_5 text_1">具体场次:上午场(09:30-12:00)</text>
|
||||||
|
<text class="self-stretch text_11">已选服务:妆发服务;摄影服务;室内;</text>
|
||||||
|
</view>
|
||||||
|
<view class="flex-row items-center shrink-0 self-start group_5">
|
||||||
|
<text class="text_8">138.</text>
|
||||||
|
<image class="shrink-0 image_2 image_3"
|
||||||
|
src="https://ide.code.fun/api/image?token=6736eddfc471750012df05d6&name=6c5700b3ac5fd83a23d838cb456bdd10.png" />
|
||||||
|
<text class="font_4 text_9">00</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="flex-row justify-end items-center self-stretch group_6">
|
||||||
|
<text class="font_2 text_12">去支付:</text>
|
||||||
|
<image class="image_2"
|
||||||
|
src="https://ide.code.fun/api/image?token=6736eddfc471750012df05d6&name=ea05ec17023763edb8cfe919508e0459.png" />
|
||||||
|
<view class="group_7">
|
||||||
|
<text class="text_13">88</text>
|
||||||
|
<text class="font_4 text_14">.00</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { ref } from 'vue'
|
||||||
|
const item = ref([null,null,null])
|
||||||
|
const goto=()=>{
|
||||||
|
uni.navigateTo({
|
||||||
|
url:'/pages/mine/bookings/bookings'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.mt-13 {
|
||||||
|
margin-top: 24.38rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ml-5 {
|
||||||
|
margin-left: 9.38rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page {
|
||||||
|
padding-bottom: 1185rpx;
|
||||||
|
background-color: #f8e8c1;
|
||||||
|
width: 100%;
|
||||||
|
overflow-y: auto;
|
||||||
|
overflow-x: hidden;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.section {
|
||||||
|
padding: 0 121.88rpx;
|
||||||
|
background-color: #fffef8;
|
||||||
|
}
|
||||||
|
|
||||||
|
.group {
|
||||||
|
padding: 21.68rpx 4.71rpx 18.23rpx 10.22rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.font {
|
||||||
|
font-size: 30rpx;
|
||||||
|
font-family: Open Sans;
|
||||||
|
line-height: 26.25rpx;
|
||||||
|
color: #323232;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text {
|
||||||
|
line-height: 27.6rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text_2 {
|
||||||
|
line-height: 27.6rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.section_2 {
|
||||||
|
background-color: #fb8b05;
|
||||||
|
width: 112.5rpx;
|
||||||
|
height: 5.63rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.section_3 {
|
||||||
|
margin-left: 16.88rpx;
|
||||||
|
margin-right: 15rpx;
|
||||||
|
padding: 35.4rpx 19.89rpx 35.4rpx 24.38rpx;
|
||||||
|
background-color: #fffef8;
|
||||||
|
border-radius: 18.75rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.font_2 {
|
||||||
|
font-size: 26.25rpx;
|
||||||
|
font-family: Open Sans;
|
||||||
|
line-height: 26.25rpx;
|
||||||
|
color: #323232;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text_3 {
|
||||||
|
color: #fb8b05;
|
||||||
|
line-height: 24.15rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.group_2 {
|
||||||
|
margin-top: 18.49rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.font_3 {
|
||||||
|
font-size: 22.5rpx;
|
||||||
|
font-family: Open Sans;
|
||||||
|
color: #818181;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text_4 {
|
||||||
|
line-height: 20.85rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text_5 {
|
||||||
|
line-height: 16.54rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.group_3 {
|
||||||
|
margin-top: 29.81rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image {
|
||||||
|
border-radius: 9.38rpx;
|
||||||
|
width: 118.13rpx;
|
||||||
|
height: 151.88rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.group_4 {
|
||||||
|
margin-left: 23.38rpx;
|
||||||
|
margin-top: 2.19rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text_6 {
|
||||||
|
line-height: 24.49rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pos {
|
||||||
|
position: absolute;
|
||||||
|
left: 0.15rpx;
|
||||||
|
top: 50%;
|
||||||
|
transform: translateY(-50%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.text_7 {
|
||||||
|
line-height: 24.43rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.font_5 {
|
||||||
|
font-size: 22.5rpx;
|
||||||
|
font-family: Open Sans;
|
||||||
|
line-height: 26.25rpx;
|
||||||
|
color: #323232;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text_10 {
|
||||||
|
margin-top: 22.91rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text_1 {
|
||||||
|
margin-top: 3.39rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text_11 {
|
||||||
|
margin-top: 20.89rpx;
|
||||||
|
color: #939393;
|
||||||
|
font-size: 22.5rpx;
|
||||||
|
font-family: Inter;
|
||||||
|
line-height: 22.97rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.group_5 {
|
||||||
|
margin-left: 3.52rpx;
|
||||||
|
margin-right: 14.59rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text_8 {
|
||||||
|
margin-left: 25.03rpx;
|
||||||
|
color: #323232;
|
||||||
|
font-size: 33.75rpx;
|
||||||
|
font-family: Open Sans;
|
||||||
|
font-weight: 600;
|
||||||
|
line-height: 24.88rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image_2 {
|
||||||
|
width: 30rpx;
|
||||||
|
height: 26.25rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image_3 {
|
||||||
|
margin-left: -90.66rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.font_4 {
|
||||||
|
font-size: 26.25rpx;
|
||||||
|
font-family: Open Sans;
|
||||||
|
line-height: 19.29rpx;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text_9 {
|
||||||
|
margin-left: 61.14rpx;
|
||||||
|
color: #323232;
|
||||||
|
}
|
||||||
|
|
||||||
|
.group_6 {
|
||||||
|
margin-top: 26.68rpx;
|
||||||
|
padding: 0 9.54rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text_12 {
|
||||||
|
margin-right: -8.06rpx;
|
||||||
|
line-height: 24.23rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.group_7 {
|
||||||
|
line-height: 21.99rpx;
|
||||||
|
height: 22.05rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text_13 {
|
||||||
|
color: #fb8b05;
|
||||||
|
font-size: 30rpx;
|
||||||
|
font-family: Open Sans;
|
||||||
|
font-weight: 600;
|
||||||
|
line-height: 21.99rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text_14 {
|
||||||
|
color: #fb8b05;
|
||||||
|
line-height: 19.39rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
@import url("../../../common/css/global.css");
|
||||||
|
</style>
|
275
pages/mine/bookings/bookings.vue
Normal file
275
pages/mine/bookings/bookings.vue
Normal file
|
@ -0,0 +1,275 @@
|
||||||
|
<template>
|
||||||
|
<view class="flex-col page">
|
||||||
|
<view class="flex-col section">
|
||||||
|
<view class="flex-row justify-between self-stretch group">
|
||||||
|
<text class="font text" @click="goto()">待消费</text>
|
||||||
|
<text class="font text_2">已消费</text>
|
||||||
|
</view>
|
||||||
|
<view class="self-end section_2"></view>
|
||||||
|
</view>
|
||||||
|
<view class="flex-col section_3 mt-16" v-for="i in item">
|
||||||
|
<text class="self-end font_2 text_3">已消费</text>
|
||||||
|
<view class="flex-row items-baseline self-stretch group_2">
|
||||||
|
<text class="font_3 text_4">订单编号:</text>
|
||||||
|
<text class="font_3 text_5 ml-5">E20241005095840091406189</text>
|
||||||
|
</view>
|
||||||
|
<view class="flex-row self-stretch group_3">
|
||||||
|
<image class="shrink-0 image"
|
||||||
|
src="https://ide.code.fun/api/image?token=6736eddfc471750012df05d6&name=bc0e955304da0a2ccafe3a66ac1f3aca.png" />
|
||||||
|
<view class="flex-col flex-1 group_4">
|
||||||
|
<view class="flex-row justify-center self-stretch relative">
|
||||||
|
<text class="font_2 text_6 pos">整套约拍</text>
|
||||||
|
<text class="font_2 text_7">【时尚精选】</text>
|
||||||
|
</view>
|
||||||
|
<text class="self-start font_5 text_10">到店日期:2024-10-15</text>
|
||||||
|
<text class="self-start font_5 text_1">具体场次:上午场(09:30-12:00)</text>
|
||||||
|
<text class="self-stretch text_11">已选服务:妆发服务;摄影服务;室内;</text>
|
||||||
|
</view>
|
||||||
|
<view class="flex-row items-center shrink-0 self-start group_5">
|
||||||
|
<text class="text_8">138.</text>
|
||||||
|
<image class="shrink-0 image_2 image_3"
|
||||||
|
src="https://ide.code.fun/api/image?token=6736eddfc471750012df05d6&name=6c5700b3ac5fd83a23d838cb456bdd10.png" />
|
||||||
|
<text class="font_4 text_9">00</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="flex-row justify-end items-center self-stretch group_6">
|
||||||
|
<text class="font_2 text_12">已付款:</text>
|
||||||
|
<image class="image_2"
|
||||||
|
src="https://ide.code.fun/api/image?token=6736eddfc471750012df05d6&name=ea05ec17023763edb8cfe919508e0459.png" />
|
||||||
|
<view class="group_7">
|
||||||
|
<text class="text_13">88</text>
|
||||||
|
<text class="font_4 text_14">.00</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="flex-col justify-start items-center self-end text-wrapper">
|
||||||
|
<text class="font_2 text_15">删除记录</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import {ref} from 'vue'
|
||||||
|
const goto = () => {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/mine/bookings/booking'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
const item =ref([null,null,null])
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.ml-5 {
|
||||||
|
margin-left: 9.38rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page {
|
||||||
|
padding-bottom: 1085.63rpx;
|
||||||
|
background-color: #f8e8c1;
|
||||||
|
width: 100%;
|
||||||
|
overflow-y: auto;
|
||||||
|
overflow-x: hidden;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.section {
|
||||||
|
padding-left: 132.09rpx;
|
||||||
|
padding-right: 116.25rpx;
|
||||||
|
background-color: #fffef8;
|
||||||
|
}
|
||||||
|
|
||||||
|
.group {
|
||||||
|
padding: 21.68rpx 0 19.16rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.font {
|
||||||
|
font-size: 30rpx;
|
||||||
|
font-family: Open Sans;
|
||||||
|
line-height: 26.25rpx;
|
||||||
|
color: #323232;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text {
|
||||||
|
line-height: 27.6rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text_2 {
|
||||||
|
margin-right: 10.33rpx;
|
||||||
|
line-height: 27.6rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.section_2 {
|
||||||
|
background-color: #fb8b05;
|
||||||
|
width: 112.5rpx;
|
||||||
|
height: 5.63rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.section_3 {
|
||||||
|
margin-left: 16.88rpx;
|
||||||
|
margin-right: 15rpx;
|
||||||
|
padding: 30rpx 20.06rpx 30rpx 24.38rpx;
|
||||||
|
background-color: #fffef8;
|
||||||
|
border-radius: 18.75rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.font_2 {
|
||||||
|
font-size: 26.25rpx;
|
||||||
|
font-family: Open Sans;
|
||||||
|
line-height: 26.25rpx;
|
||||||
|
color: #323232;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text_3 {
|
||||||
|
color: #fb8b05;
|
||||||
|
line-height: 24.15rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.group_2 {
|
||||||
|
margin-top: 18.49rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.font_3 {
|
||||||
|
font-size: 22.5rpx;
|
||||||
|
font-family: Open Sans;
|
||||||
|
color: #818181;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text_4 {
|
||||||
|
line-height: 20.85rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text_5 {
|
||||||
|
line-height: 16.54rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.group_3 {
|
||||||
|
margin-top: 29.81rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image {
|
||||||
|
border-radius: 9.38rpx;
|
||||||
|
width: 118.13rpx;
|
||||||
|
height: 151.88rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.group_4 {
|
||||||
|
margin: 2.19rpx 0 5.38rpx 23.38rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text_6 {
|
||||||
|
line-height: 24.49rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pos {
|
||||||
|
position: absolute;
|
||||||
|
left: 0.15rpx;
|
||||||
|
top: 50%;
|
||||||
|
transform: translateY(-50%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.text_7 {
|
||||||
|
line-height: 24.43rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.font_5 {
|
||||||
|
font-size: 22.5rpx;
|
||||||
|
font-family: Open Sans;
|
||||||
|
line-height: 26.25rpx;
|
||||||
|
color: #323232;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text_10 {
|
||||||
|
margin-top: 21.04rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text_1 {
|
||||||
|
margin-top: 3.39rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text_11 {
|
||||||
|
margin-top: 19.01rpx;
|
||||||
|
color: #939393;
|
||||||
|
font-size: 22.5rpx;
|
||||||
|
font-family: Inter;
|
||||||
|
line-height: 22.97rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.group_5 {
|
||||||
|
margin-left: 3.52rpx;
|
||||||
|
margin-right: 14.42rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text_8 {
|
||||||
|
margin-left: 25.03rpx;
|
||||||
|
color: #323232;
|
||||||
|
font-size: 33.75rpx;
|
||||||
|
font-family: Open Sans;
|
||||||
|
font-weight: 600;
|
||||||
|
line-height: 24.88rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image_2 {
|
||||||
|
width: 30rpx;
|
||||||
|
height: 26.25rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image_3 {
|
||||||
|
margin-left: -90.66rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.font_4 {
|
||||||
|
font-size: 26.25rpx;
|
||||||
|
font-family: Open Sans;
|
||||||
|
line-height: 19.29rpx;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text_9 {
|
||||||
|
margin-left: 61.14rpx;
|
||||||
|
color: #323232;
|
||||||
|
}
|
||||||
|
|
||||||
|
.group_6 {
|
||||||
|
margin-top: 37.93rpx;
|
||||||
|
padding: 0 9.38rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text_12 {
|
||||||
|
margin-right: -8.06rpx;
|
||||||
|
line-height: 24.23rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.group_7 {
|
||||||
|
line-height: 21.99rpx;
|
||||||
|
height: 22.05rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text_13 {
|
||||||
|
color: #fb8b05;
|
||||||
|
font-size: 30rpx;
|
||||||
|
font-family: Open Sans;
|
||||||
|
font-weight: 600;
|
||||||
|
line-height: 21.99rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text_14 {
|
||||||
|
color: #fb8b05;
|
||||||
|
line-height: 19.39rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-wrapper {
|
||||||
|
margin-right: 2.44rpx;
|
||||||
|
margin-top: 35.4rpx;
|
||||||
|
padding: 13.54rpx 0 14.83rpx;
|
||||||
|
background-color: #fffef8;
|
||||||
|
border-radius: 75rpx;
|
||||||
|
width: 155.63rpx;
|
||||||
|
border: solid 1.88rpx #cbcbcb;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text_15 {
|
||||||
|
line-height: 24.13rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
@import url('../../../common/css/global.css')
|
||||||
|
</style>
|
799
pages/text.vue
799
pages/text.vue
|
@ -1,4 +1,4 @@
|
||||||
|
<!--
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<view class="addres">
|
<view class="addres">
|
||||||
|
@ -40,4 +40,801 @@ onLoad((options) => {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
</style> -->
|
||||||
|
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<!-- 弹窗 -->
|
||||||
|
<uni-popup ref="popup1" v-if="showPopup1" :mask-click="false" background-color="white">
|
||||||
|
<view style="text-align: center;margin: 10px;font-size: 18px;">预约须知</view>
|
||||||
|
<view style="margin: 0 20px;">1.成功预约的顾客需按照预定时间前往店内挑选相应级别的服装。
|
||||||
|
为确保衣物在体验过程中的完好无损,顾客需根据所选服装的级别补缴尾款以及相应的押金。
|
||||||
|
拍摄结束后,店铺将依据衣物的实际状况评估是否扣除押金。</view>
|
||||||
|
<view style="margin: 0 20px;">
|
||||||
|
2.其中部分物品商家可提供,属于增值服务(如一次性隐形眼镜、
|
||||||
|
一次性粉扑等属于服务费以外的赠送服务,买家可选择自带用品,不影响服务价格),
|
||||||
|
需要买家自己准备的,客服需要提前告诉买家(如胸贴等贴身物品)
|
||||||
|
</view>
|
||||||
|
<button @click="close1" style="width: 50%;background-color:#f2b600;border-radius: 30px;margin-top: 20px;
|
||||||
|
margin-bottom: 20px;">我知道了</button>
|
||||||
|
</uni-popup>
|
||||||
|
<uni-popup ref="popup2" v-if="showPopup2" :mask-click="false" background-color="white">
|
||||||
|
<view style="text-align: center;margin: 10px;font-size: 18px;">费用说明</view>
|
||||||
|
<view style="margin: 10px;"> 一、费用支付流程</view>
|
||||||
|
<view style="margin: 0 20px;">
|
||||||
|
<view>1.确定等级:您将根据个人需求选择合适的服装价位区间,并完成预约操作。</view>
|
||||||
|
<view>2.预约成功:预约成功后,您需前往店铺挑选对应等级的服装。</view>
|
||||||
|
<view>3.补缴尾款及押金:在挑选服装时,您需要补缴尾款(扣除已支付定金后的剩余服务或商品费用)以及押金(用于保障服装归还时的完好)。</view>
|
||||||
|
</view>
|
||||||
|
<view style="margin: 10px;"> 二、尾款具体事项</view>
|
||||||
|
<view style="margin: 0 20px;">
|
||||||
|
<view>1.租赁服装:若您选择租赁我们店铺没有的服装,租赁费用将在您支付尾款时一并结算。无论拍摄是否进行,租赁费用均不予退还。</view>
|
||||||
|
<view>2.购买服装:如您希望购买我们店铺的服装,且我们同意购买,将按照服装的稀有程度分等级定价。您需按照所选等级支付尾款。</view>
|
||||||
|
<view>3.定制服务:若您自带衣服,我们提供妆发及摄影服务。若需我们额外购买服装,将按照上述等级定价,您需支付相应的尾款。</view>
|
||||||
|
</view>
|
||||||
|
<view style="margin: 10px;"> 三、定金与押金说明</view>
|
||||||
|
<view style="margin: 0 20px;">
|
||||||
|
<view>1.定金:预约时支付的定金用于确认您的预约意向,定金不予退还。</view>
|
||||||
|
<view>2.押金:拍摄完成后,我们将根据服装的归还情况决定是否扣除押金。若服装无损坏,押金将全额退还。</view>
|
||||||
|
</view>
|
||||||
|
<view style="margin: 10px;"> 四、特殊情况处理</view>
|
||||||
|
<view style="margin: 0 20px;">
|
||||||
|
<view> 若因特殊情况您需要取消预约,请及时与我们联系。未拍摄情况下,定金不予退还,已支付的租赁费用亦不退还。</view>
|
||||||
|
</view>
|
||||||
|
<button @click="close2" style="width: 50%;background-color:#f2b600;border-radius: 30px;margin-top: 20px;
|
||||||
|
margin-bottom: 20px;">我知道了</button>
|
||||||
|
</uni-popup>
|
||||||
|
<view class="flex-col page" >
|
||||||
|
<view class="flex-col justify-start items-start relative group" @click="goToContact()"> <!-- @click="goToContact()" -->
|
||||||
|
<view class="section"></view>
|
||||||
|
<text class="font text pos">填写预约信息</text>
|
||||||
|
<view class="flex-col section_2 pos_2">
|
||||||
|
<view class="flex-row justify-between items-center group_2">
|
||||||
|
<view class="flex-row items-center">
|
||||||
|
<image class="shrink-0 image"
|
||||||
|
src="https://ide.code.fun/api/image?token=672dbef4c471750012de4bf6&name=8bde7b2f7a6da1a009b89295a48cc8ec.png" />
|
||||||
|
<text class="font_2 text_2 ml-7">联系人:张三</text>
|
||||||
|
<text class="font_2 text_3 ml-7">15888610253</text>
|
||||||
|
</view>
|
||||||
|
<image class="image_2"
|
||||||
|
src="https://ide.code.fun/api/image?token=672dbef4c471750012de4bf6&name=10d9d3f5abdae8518f3c6c3fa1bbb544.png" />
|
||||||
|
</view>
|
||||||
|
<view class="flex-row justify-between items-center group_3">
|
||||||
|
<view class="flex-row items-center">
|
||||||
|
<image class="image"
|
||||||
|
src="https://ide.code.fun/api/image?token=672dbef4c471750012de4bf6&name=c6dac3074d9c4e4d6286c07f0ea03db5.png" />
|
||||||
|
<view class="flex-col items-start ml-9">
|
||||||
|
<text class="font_3">到店日期:2024-10-15</text>
|
||||||
|
<text class="mt-2 font_3">具体场次:上午场(09:30-12:00)</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<image class="image_2"
|
||||||
|
src="https://ide.code.fun/api/image?token=672dbef4c471750012de4bf6&name=10d9d3f5abdae8518f3c6c3fa1bbb544.png" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="flex-col group_4">
|
||||||
|
<text class="self-start font text_4">选择预约类别</text>
|
||||||
|
<view class="mt-14 flex-col justify-start self-stretch section_3">
|
||||||
|
<view class="flex-row equal-division">
|
||||||
|
<view class=" clickable-item " @click="showWhole('0')">
|
||||||
|
<image class="image_3"
|
||||||
|
src="https://carbon2.obs.cn-north-4.myhuaweicloud.com:443/feiyi%2Ftest%2F0%2FQdGvHpRx-paishe.png" />
|
||||||
|
<text class="mt-2 font_4 text_5">整套约拍</text>
|
||||||
|
</view>
|
||||||
|
<view class=" ml-23 clickable-item" @click="showOwn('1')">
|
||||||
|
<image class="image_3"
|
||||||
|
src="https://carbon2.obs.cn-north-4.myhuaweicloud.com:443/feiyi%2Ftest%2F0%2FWJdpNSbl-000.png" />
|
||||||
|
<text class="mt-2 font_4">自带服装</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<template v-if="zhi === '0'" >
|
||||||
|
<view class="flex-col section_7" >
|
||||||
|
<view class="flex-col group_5">
|
||||||
|
<text class="self-start font text_6">选择服装价位</text>
|
||||||
|
<view class="flex-row items-center self-stretch section_8 view" v-for="(item,index) in Whole" :key="item" @click="goToText(index)" >
|
||||||
|
<image :src="item.image" class="shrink-0 image_4"></image>
|
||||||
|
<view class="flex-col flex-1 ml-13">
|
||||||
|
<view class="self-start font_2 text_7">{{item.clothesType}}</view>
|
||||||
|
<view class="flex-row items-baseline self-stretch mt-11">
|
||||||
|
<text class="font_2">价位:</text>
|
||||||
|
<view class="font_6 text_8 ml-1">¥{{item.minPrice}}--{{item.maxPrice}}</view>
|
||||||
|
</view>
|
||||||
|
<view class="self-stretch font_7 text_9 mt-11">{{item.brief}}</view>
|
||||||
|
</view>
|
||||||
|
<view class="flex-row shrink-0 ml-21">
|
||||||
|
<view class="flex-col justify-start items-center button"><text class="font_5">选择</text></view>
|
||||||
|
<image class="ml-8 image_5"
|
||||||
|
src="https://ide.code.fun/api/image?token=672dbef4c471750012de4bf6&name=7d16fc8dfa328fc97ff273ebeab9bc18.png" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="flex-col">
|
||||||
|
<view class="flex-col group_6">
|
||||||
|
<view class="flex-col">
|
||||||
|
<text class="self-start font text_15">选择拍摄场景</text>
|
||||||
|
<view class="flex-row self-stretch mt-15">
|
||||||
|
<view class="flex-row justify-center items-center section_9">
|
||||||
|
<image class="image_7"
|
||||||
|
src="https://carbon2.obs.cn-north-4.myhuaweicloud.com:443/feiyi%2Ftest%2F0%2FDSCeqARd-shinei.png" />
|
||||||
|
<text class="ml-16 font_8 text_16">室内</text>
|
||||||
|
<checkbox class="ml-16" name="location" value="室内"></checkbox>
|
||||||
|
</view>
|
||||||
|
<view class="flex-row justify-center items-center section_9 ml-23">
|
||||||
|
<image class="image_7"
|
||||||
|
src="https://carbon2.obs.cn-north-4.myhuaweicloud.com:443/feiyi%2Ftest%2F0%2FgfjDWgWY-shiwai.png" />
|
||||||
|
<text class="ml-16 font_8 text_17">室外</text>
|
||||||
|
<checkbox class="ml-16" name="location" value="室外"></checkbox>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="mt-26 flex-row justify-center items-center" @click="openPopup1">
|
||||||
|
<image class="badge"
|
||||||
|
src="https://carbon2.obs.cn-north-4.myhuaweicloud.com:443/feiyi%2Ftest%2F0%2FkWvkHOaM-0e7d6a68aaa19d61293070fa98a3ae13.png" />
|
||||||
|
<text class="ml-4 font_7 text_18">预约须知</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
<template v-if="zhi === '1'" >
|
||||||
|
<view class="flex-col section_7">
|
||||||
|
<view class="flex-col group_5">
|
||||||
|
<text class="self-start font text_6">选择服务</text>
|
||||||
|
<view class="flex-row items-center self-stretch section_8 view" v-for="item in Own" :key="item" >
|
||||||
|
<image :src="item.img" class="shrink-0 image_4"></image>
|
||||||
|
<view class="flex-col flex-1 ml-13">
|
||||||
|
<view class="self-start font_2 text_7">{{item.name}}</view>
|
||||||
|
<view class="flex-row items-baseline self-stretch mt-11">
|
||||||
|
<text class="font_2">价位:</text>
|
||||||
|
<view class="font_6 text_8 ml-1">¥{{item.price}}</view>
|
||||||
|
</view>
|
||||||
|
<view class="self-stretch font_7 text_9 mt-11">{{item.title}}</view>
|
||||||
|
</view>
|
||||||
|
<view class="flex-row shrink-0 ml-21">
|
||||||
|
<checkbox></checkbox>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="flex-col">
|
||||||
|
<view class="flex-col group_6">
|
||||||
|
<view class="flex-col">
|
||||||
|
<text class="self-start font text_15">选择拍摄场景</text>
|
||||||
|
<view class="flex-row self-stretch mt-15">
|
||||||
|
<view class="flex-row justify-center items-center section_9">
|
||||||
|
<image class="image_7"
|
||||||
|
src="https://carbon2.obs.cn-north-4.myhuaweicloud.com:443/feiyi%2Ftest%2F0%2FDSCeqARd-shinei.png" />
|
||||||
|
<text class="ml-16 font_8 text_16">室内</text>
|
||||||
|
<checkbox class="ml-16" name="location" value="室内"></checkbox>
|
||||||
|
</view>
|
||||||
|
<view class="flex-row justify-center items-center section_9 ml-23">
|
||||||
|
<image class="image_7"
|
||||||
|
src="https://carbon2.obs.cn-north-4.myhuaweicloud.com:443/feiyi%2Ftest%2F0%2FgfjDWgWY-shiwai.png" />
|
||||||
|
<text class="ml-16 font_8 text_17">室外</text>
|
||||||
|
<checkbox class="ml-16" name="location" value="室外"></checkbox>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="flex-row self-stretch section_12">
|
||||||
|
<image class="shrink-0 self-center image_66"
|
||||||
|
src="https://carbon2.obs.cn-north-4.myhuaweicloud.com:443/feiyi%2Ftest%2F0%2FbtvtZqGC-kefu.png" />
|
||||||
|
<view class="flex-col shrink-0 self-start group_10">
|
||||||
|
<text class="self-start font_2 text_12">联系客服</text>
|
||||||
|
<text class="mt-10 self-stretch font_66">请提供详细的问题描述,以便我们更快地为您解决问题。</text>
|
||||||
|
</view>
|
||||||
|
<image class="shrink-0 self-center image image_77"
|
||||||
|
src="https://ide.code.fun/api/image?token=67303857c471750012de63be&name=136eb7cb0ccc86c9685bc319ce005613.png" />
|
||||||
|
</view>
|
||||||
|
<view class="mt-26 flex-row justify-center items-center" @click="openPopup1">
|
||||||
|
<image class="badge"
|
||||||
|
src="https://carbon2.obs.cn-north-4.myhuaweicloud.com:443/feiyi%2Ftest%2F0%2FkWvkHOaM-0e7d6a68aaa19d61293070fa98a3ae13.png" />
|
||||||
|
<text class="ml-4 font_7 text_18">预约须知</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
<view class="flex-row justify-between items-center section_11">
|
||||||
|
<view class="flex-row items-center group_7">
|
||||||
|
<view class="flex-col justify-start items-start shrink-0 relative">
|
||||||
|
<text class="font_8">定金:</text>
|
||||||
|
<image class="image_2 pos_4"
|
||||||
|
src="https://ide.code.fun/api/image?token=672dbef4c471750012de4bf6&name=3393d3563afcfe7dedbadba1ea5328a0.png" />
|
||||||
|
</view>
|
||||||
|
<text class="font_6 text_19">88.</text>
|
||||||
|
<text class="text_21">00</text>
|
||||||
|
</view>
|
||||||
|
<view class="flex-row items-center">
|
||||||
|
<view class="flex-row button_3" @click="openPopup2">
|
||||||
|
<text class="text_22">费用说明</text>
|
||||||
|
<image class="shrink-0 image_8 ml-3"
|
||||||
|
src="https://ide.code.fun/api/image?token=672dbef4c471750012de4bf6&name=0455b173571a47fdc438588e788f26c5.png" />
|
||||||
|
</view>
|
||||||
|
<view class="ml-10 flex-col justify-start items-center button_2">
|
||||||
|
<text class="font_4 text_20">确定预约</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import {
|
||||||
|
ref
|
||||||
|
} from 'vue';
|
||||||
|
import { baseUrl } from '../api/request';
|
||||||
|
const displayItem = ref([])
|
||||||
|
const Whole = ref([{}])
|
||||||
|
const getWhole = async()=>{
|
||||||
|
const res = await uni.request({
|
||||||
|
url: baseUrl + '/clothesGrade/list',
|
||||||
|
method:'POST',
|
||||||
|
header:{
|
||||||
|
cookie:wx.getAccountInfoSync('cookie')
|
||||||
|
},
|
||||||
|
data:{
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
if(res.data.code === 1){
|
||||||
|
Whole.value=res.data.data
|
||||||
|
}else{
|
||||||
|
uin.showtoast({
|
||||||
|
icon:'error',
|
||||||
|
title:'获取失败'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const Own = ref([{
|
||||||
|
img: 'https://carbon2.obs.cn-north-4.myhuaweicloud.com:443/feiyi%2Ftest%2F0%2FObQGBPnJ-zhuangfa.png',
|
||||||
|
name: '妆发预约',
|
||||||
|
price: '20',
|
||||||
|
title: '包括底妆,眉毛,眼妆,腮红和唇妆,根据您的肤色和服装风格进行个性化设计'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
img: 'https://carbon2.obs.cn-north-4.myhuaweicloud.com:443/feiyi%2Ftest%2F0%2FDFNymmCN-sheying.png',
|
||||||
|
name: '摄影服务',
|
||||||
|
price: '15',
|
||||||
|
title: '提供专业的摄影棚和灯光设备,为客户打造舒适的拍摄环境'
|
||||||
|
}
|
||||||
|
])
|
||||||
|
const zhi = ref('0')
|
||||||
|
|
||||||
|
const showWhole = (zhiValue) => {
|
||||||
|
zhi.value = zhiValue
|
||||||
|
console.log(zhi.value)
|
||||||
|
}
|
||||||
|
|
||||||
|
const showOwn = (zhiValue) => {
|
||||||
|
zhi.value = zhiValue
|
||||||
|
console.log(zhi.value)
|
||||||
|
}
|
||||||
|
|
||||||
|
const close1 = () => {
|
||||||
|
popup1.value.close()
|
||||||
|
}
|
||||||
|
const close2 = () => {
|
||||||
|
popup2.value.close()
|
||||||
|
}
|
||||||
|
|
||||||
|
const popup1 = ref(null)
|
||||||
|
const popup2 = ref(null)
|
||||||
|
const showPopup1 = ref(false)
|
||||||
|
const showPopup2 = ref(false)
|
||||||
|
|
||||||
|
const openPopup1 = () => {
|
||||||
|
showPopup1.value = true;
|
||||||
|
popup1.value.open('center');
|
||||||
|
}
|
||||||
|
|
||||||
|
const openPopup2 = () => {
|
||||||
|
showPopup2.value = true;
|
||||||
|
popup2.value.open('center');
|
||||||
|
}
|
||||||
|
|
||||||
|
const closePopup1 = () => {
|
||||||
|
showPopup1.value = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
const closePopup2 = () => {
|
||||||
|
showPopup2.value = false;
|
||||||
|
}
|
||||||
|
const selectedLocation = ref(null)
|
||||||
|
const handleFormSubmit = () => {
|
||||||
|
selectedLocation.value = null
|
||||||
|
}
|
||||||
|
const goToText = (index) =>{
|
||||||
|
console.log(index);
|
||||||
|
uni.navigateTo({
|
||||||
|
url:"/pages/booking/CostumeDisplay/CostumeDisplay?info="
|
||||||
|
+ JSON.stringify(Whole.value[index])
|
||||||
|
})
|
||||||
|
}
|
||||||
|
const goToContact = ()=>{
|
||||||
|
uni.navigateTo({
|
||||||
|
url:'/pages/mine/Contact/Contact'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
console.log(Whole.value[1])
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.ml-7 {
|
||||||
|
margin-left: 13.13rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ml-9 {
|
||||||
|
margin-left: 16.88rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ml-13 {
|
||||||
|
margin-left: 24.38rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ml-21 {
|
||||||
|
margin-left: 39.38rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ml-1 {
|
||||||
|
margin-left: 1.88rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mt-15 {
|
||||||
|
margin-top: 28.13rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ml-23 {
|
||||||
|
margin-left: 43.13rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mt-11 {
|
||||||
|
margin-top: 20.63rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ml-3 {
|
||||||
|
margin-left: 5.63rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page {
|
||||||
|
padding-top: 45rpx;
|
||||||
|
background-color: #f5f5dc;
|
||||||
|
width: 100%;
|
||||||
|
overflow-y: auto;
|
||||||
|
overflow-x: hidden;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
.font_66 {
|
||||||
|
font-size: 22.5rpx;
|
||||||
|
font-family: Open Sans;
|
||||||
|
line-height: 26.25rpx;
|
||||||
|
color: #898989;
|
||||||
|
}
|
||||||
|
.group {
|
||||||
|
padding-top: 11.25rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.section {
|
||||||
|
margin-left: 71.25rpx;
|
||||||
|
background-color: #ffffff00;
|
||||||
|
border-radius: 18.75rpx;
|
||||||
|
width: 281.25rpx;
|
||||||
|
height: 281.25rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.font {
|
||||||
|
font-size: 30rpx;
|
||||||
|
font-family: Open Sans;
|
||||||
|
line-height: 27.75rpx;
|
||||||
|
color: #323232;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text {
|
||||||
|
line-height: 27.96rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pos {
|
||||||
|
position: absolute;
|
||||||
|
left: 21.62rpx;
|
||||||
|
top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.section_2 {
|
||||||
|
padding-left: 33.75rpx;
|
||||||
|
padding-right: 28.13rpx;
|
||||||
|
background-color: #fffef8;
|
||||||
|
border-radius: 18.75rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pos_2 {
|
||||||
|
position: absolute;
|
||||||
|
left: 20.63rpx;
|
||||||
|
right: 20.63rpx;
|
||||||
|
top: 53.63rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.group_2 {
|
||||||
|
padding: 31.88rpx 0 15rpx;
|
||||||
|
border-bottom: solid 1.88rpx #e2e0e0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image {
|
||||||
|
width: 43.13rpx;
|
||||||
|
height: 43.13rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.font_2 {
|
||||||
|
font-size: 26.25rpx;
|
||||||
|
font-family: Open Sans;
|
||||||
|
line-height: 24.3rpx;
|
||||||
|
color: #323232;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text_2 {
|
||||||
|
line-height: 24rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text_3 {
|
||||||
|
line-height: 24rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image_2 {
|
||||||
|
width: 33.75rpx;
|
||||||
|
height: 33.75rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.group_3 {
|
||||||
|
padding: 22.5rpx 0 37.5rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.font_3 {
|
||||||
|
font-size: 26.25rpx;
|
||||||
|
font-family: Open Sans;
|
||||||
|
line-height: 31.88rpx;
|
||||||
|
color: #323232;
|
||||||
|
}
|
||||||
|
|
||||||
|
.group_4 {
|
||||||
|
margin-top: 26.25rpx;
|
||||||
|
padding: 0 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text_4 {
|
||||||
|
line-height: 27.69rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.section_3 {
|
||||||
|
padding: 31.88rpx 0;
|
||||||
|
background-color: #fffef8;
|
||||||
|
border-radius: 18.75rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.equal-division {
|
||||||
|
margin: 0 41.25rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.section_4 {
|
||||||
|
flex: 1 1 281.25rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image_3 {
|
||||||
|
width: 192rpx;
|
||||||
|
height: 192rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.font_4 {
|
||||||
|
font-size: 30rpx;
|
||||||
|
font-family: Inter;
|
||||||
|
line-height: 27.75rpx;
|
||||||
|
color: #323232;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text_5 {
|
||||||
|
line-height: 27.99rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.section_5 {
|
||||||
|
position: relative;
|
||||||
|
flex: 1 1 281.25rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.clickable-item {
|
||||||
|
padding: 15rpx 0 41.25rpx;
|
||||||
|
background-color: white;
|
||||||
|
border-radius: 18.75rpx;
|
||||||
|
height: 281.25rpx;
|
||||||
|
flex: 1 1 281.25rpx;
|
||||||
|
align-items: center;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
box-sizing: border-box;
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.clickable-item.selected {
|
||||||
|
background-color: #f08b00;
|
||||||
|
}
|
||||||
|
|
||||||
|
.clickable-item.selected::after {
|
||||||
|
background-color: #f08b00;
|
||||||
|
}
|
||||||
|
.section_6 {
|
||||||
|
background-color: #ffffff99;
|
||||||
|
border-radius: 18.75rpx;
|
||||||
|
width: 281.25rpx;
|
||||||
|
height: 281.25rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pos_3 {
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
top: 0;
|
||||||
|
bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.section_7 {
|
||||||
|
margin-top: 30rpx;
|
||||||
|
padding-bottom: 46.88rpx;
|
||||||
|
background-color: #fff3c3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.group_5 {
|
||||||
|
padding: 30rpx 30rpx 37.5rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text_6 {
|
||||||
|
line-height: 27.86rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.section_8 {
|
||||||
|
margin-top: 16.88rpx;
|
||||||
|
padding: 26.25rpx 26.25rpx 26.25rpx 39.38rpx;
|
||||||
|
background-color: #fffef8;
|
||||||
|
border-radius: 18.75rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.view {
|
||||||
|
margin-top: 41.25rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image_4 {
|
||||||
|
border-radius: 9.38rpx;
|
||||||
|
width: 118.13rpx;
|
||||||
|
height: 151.88rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text_7 {
|
||||||
|
line-height: 24.26rpx;
|
||||||
|
}
|
||||||
|
.text_77 {
|
||||||
|
line-height: 24.96rpx;
|
||||||
|
}
|
||||||
|
.font_6 {
|
||||||
|
font-size: 33.75rpx;
|
||||||
|
font-family: Open Sans;
|
||||||
|
line-height: 24.3rpx;
|
||||||
|
color: #ff3c3c;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text_8 {
|
||||||
|
line-height: 24.81rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.button {
|
||||||
|
padding: 7.5rpx 0;
|
||||||
|
background-color: #fbb612;
|
||||||
|
border-radius: 9.38rpx;
|
||||||
|
width: 75rpx;
|
||||||
|
height: 37.5rpx;
|
||||||
|
}
|
||||||
|
.button2 {
|
||||||
|
padding: 7.5rpx 0;
|
||||||
|
background-color: #f5f5dc;
|
||||||
|
border-radius: 50rpx;
|
||||||
|
width: 37.5rpx;
|
||||||
|
height: 37.5rpx;
|
||||||
|
}
|
||||||
|
.font_5 {
|
||||||
|
font-size: 22.5rpx;
|
||||||
|
font-family: Open Sans;
|
||||||
|
line-height: 20.72rpx;
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image_5 {
|
||||||
|
width: 37.5rpx;
|
||||||
|
height: 37.5rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text_10 {
|
||||||
|
line-height: 24.15rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text_12 {
|
||||||
|
line-height: 24.81rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-wrapper {
|
||||||
|
padding: 7.5rpx 0;
|
||||||
|
background-color: #d9d9d9;
|
||||||
|
border-radius: 9.38rpx;
|
||||||
|
width: 75rpx;
|
||||||
|
height: 37.5rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text_11 {
|
||||||
|
line-height: 20.61rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image_6 {
|
||||||
|
width: 118.13rpx;
|
||||||
|
height: 151.88rpx;
|
||||||
|
}
|
||||||
|
.image_66 {
|
||||||
|
border-radius: 9.38rpx;
|
||||||
|
width: 93.75rpx;
|
||||||
|
height: 118.13rpx;
|
||||||
|
}
|
||||||
|
.text_14 {
|
||||||
|
line-height: 24.23rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.divider {
|
||||||
|
margin: 0 22.5rpx;
|
||||||
|
background-color: #ff8550;
|
||||||
|
height: 1.88rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.group_6 {
|
||||||
|
padding: 22.5rpx 30rpx 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text_15 {
|
||||||
|
line-height: 27.64rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.section_9 {
|
||||||
|
flex: 1 1 322.5rpx;
|
||||||
|
padding: 26.25rpx 0;
|
||||||
|
background-color: #fffef8;
|
||||||
|
border-radius: 18.75rpx;
|
||||||
|
height: 153.75rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image_7 {
|
||||||
|
border-radius: 9.38rpx;
|
||||||
|
width: 123.75rpx;
|
||||||
|
height: 101.25rpx;
|
||||||
|
}
|
||||||
|
.image_77 {
|
||||||
|
margin-left: 48.75rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.font_8 {
|
||||||
|
font-size: 26.25rpx;
|
||||||
|
font-family: Inter;
|
||||||
|
line-height: 24.3rpx;
|
||||||
|
color: #000000;
|
||||||
|
}
|
||||||
|
.group_10 {
|
||||||
|
margin-left: 22.5rpx;
|
||||||
|
margin-top: 15rpx;
|
||||||
|
width: 405rpx;
|
||||||
|
}
|
||||||
|
.text_16 {
|
||||||
|
line-height: 24.21rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.section_10 {
|
||||||
|
background-color: #ffffff;
|
||||||
|
border-radius: 50%;
|
||||||
|
width: 33.75rpx;
|
||||||
|
height: 33.75rpx;
|
||||||
|
border-left: solid 1.88rpx #c4c4c4;
|
||||||
|
border-right: solid 1.88rpx #c4c4c4;
|
||||||
|
border-top: solid 1.88rpx #c4c4c4;
|
||||||
|
border-bottom: solid 1.88rpx #c4c4c4;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text_17 {
|
||||||
|
line-height: 24.09rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.badge {
|
||||||
|
width: 28.13rpx;
|
||||||
|
height: 28.13rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.font_7 {
|
||||||
|
font-size: 22.5rpx;
|
||||||
|
font-family: Open Sans;
|
||||||
|
line-height: 20.72rpx;
|
||||||
|
color: #8a8a8a;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text_13 {
|
||||||
|
line-height: 21.38rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text_9 {
|
||||||
|
line-height: 21.36rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text_18 {
|
||||||
|
color: #000000;
|
||||||
|
line-height: 20.77rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.section_11 {
|
||||||
|
margin-top: 48.75rpx;
|
||||||
|
padding: 15rpx 22.5rpx;
|
||||||
|
background-color: #fffef8;
|
||||||
|
}
|
||||||
|
|
||||||
|
.group_7 {
|
||||||
|
width: 180.06rpx;
|
||||||
|
}
|
||||||
|
.group_77{
|
||||||
|
margin-left: 37.5rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pos_4 {
|
||||||
|
position: absolute;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text_19 {
|
||||||
|
color: #fbb612;
|
||||||
|
font-weight: 700;
|
||||||
|
line-height: 24.84rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text_21 {
|
||||||
|
color: #fbb612;
|
||||||
|
font-size: 26.25rpx;
|
||||||
|
font-family: Open Sans;
|
||||||
|
font-weight: 700;
|
||||||
|
line-height: 19.29rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.button_3 {
|
||||||
|
padding: 9.38rpx 11.25rpx;
|
||||||
|
background-color: #d9d9d9;
|
||||||
|
border-radius: 9.38rpx;
|
||||||
|
height: 37.5rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text_22 {
|
||||||
|
color: #323232;
|
||||||
|
font-size: 18.75rpx;
|
||||||
|
font-family: Inter;
|
||||||
|
line-height: 17.36rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image_8 {
|
||||||
|
width: 18.75rpx;
|
||||||
|
height: 18.75rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.button_2 {
|
||||||
|
padding: 26.25rpx 0;
|
||||||
|
background-color: #fbb612;
|
||||||
|
border-radius: 75rpx;
|
||||||
|
width: 238.13rpx;
|
||||||
|
height: 82.5rpx;
|
||||||
|
}
|
||||||
|
.text_20 {
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.section_12 {
|
||||||
|
margin: 26.25rpx 16.88rpx 0 11.25rpx;
|
||||||
|
padding: 15rpx 26.25rpx;
|
||||||
|
background-color: #fffef8;
|
||||||
|
border-radius: 18.75rpx;
|
||||||
|
}
|
||||||
|
@import url(/common/css/global.css);
|
||||||
</style>
|
</style>
|
2
unpackage/dist/dev/mp-weixin/addProduct.js
vendored
2
unpackage/dist/dev/mp-weixin/addProduct.js
vendored
|
@ -75,5 +75,5 @@ const _sfc_main = {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-ac6f555c"]]);
|
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-ac6f555c"], ["__file", "D:/jiangchengfeiyi-xiaochengxu/pages/Shopping-cart/component/addProduct.vue"]]);
|
||||||
exports.MiniProgramPage = MiniProgramPage;
|
exports.MiniProgramPage = MiniProgramPage;
|
||||||
|
|
8
unpackage/dist/dev/mp-weixin/app.js
vendored
8
unpackage/dist/dev/mp-weixin/app.js
vendored
|
@ -27,13 +27,17 @@ if (!Math) {
|
||||||
"./pages/Shopping-cart/component/addProduct.js";
|
"./pages/Shopping-cart/component/addProduct.js";
|
||||||
"./pages/mine/OrderDetails/OrderDetails.js";
|
"./pages/mine/OrderDetails/OrderDetails.js";
|
||||||
"./pages/service/productDetail/productDetail.js";
|
"./pages/service/productDetail/productDetail.js";
|
||||||
"./pages/workshop/index/index.js";
|
"./pages/mine/bookings/booking.js";
|
||||||
|
"./pages/mine/bookings/bookings.js";
|
||||||
|
"./pages/mine/Contact/Contact.js";
|
||||||
|
"./pages/booking/CostumeDisplay/CostumeDisplay.js";
|
||||||
|
"./pages/booking/CostumeDetails/CostumeDetails.js";
|
||||||
}
|
}
|
||||||
const _sfc_main = {};
|
const _sfc_main = {};
|
||||||
function _sfc_render(_ctx, _cache) {
|
function _sfc_render(_ctx, _cache) {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
const App = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
|
const App = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "D:/jiangchengfeiyi-xiaochengxu/App.vue"]]);
|
||||||
function createApp() {
|
function createApp() {
|
||||||
const app = common_vendor.createSSRApp(App);
|
const app = common_vendor.createSSRApp(App);
|
||||||
app.use(store_index.pinia);
|
app.use(store_index.pinia);
|
||||||
|
|
6
unpackage/dist/dev/mp-weixin/app.json
vendored
6
unpackage/dist/dev/mp-weixin/app.json
vendored
|
@ -24,7 +24,11 @@
|
||||||
"pages/Shopping-cart/component/addProduct",
|
"pages/Shopping-cart/component/addProduct",
|
||||||
"pages/mine/OrderDetails/OrderDetails",
|
"pages/mine/OrderDetails/OrderDetails",
|
||||||
"pages/service/productDetail/productDetail",
|
"pages/service/productDetail/productDetail",
|
||||||
"pages/workshop/index/index"
|
"pages/mine/bookings/booking",
|
||||||
|
"pages/mine/bookings/bookings",
|
||||||
|
"pages/mine/Contact/Contact",
|
||||||
|
"pages/booking/CostumeDisplay/CostumeDisplay",
|
||||||
|
"pages/booking/CostumeDetails/CostumeDetails"
|
||||||
],
|
],
|
||||||
"window": {
|
"window": {
|
||||||
"navigationBarTextStyle": "black",
|
"navigationBarTextStyle": "black",
|
||||||
|
|
21
unpackage/dist/dev/mp-weixin/common/vendor.js
vendored
21
unpackage/dist/dev/mp-weixin/common/vendor.js
vendored
|
@ -180,6 +180,7 @@ const stringifySymbol = (v, i = "") => {
|
||||||
var _a;
|
var _a;
|
||||||
return isSymbol(v) ? `Symbol(${(_a = v.description) != null ? _a : i})` : v;
|
return isSymbol(v) ? `Symbol(${(_a = v.description) != null ? _a : i})` : v;
|
||||||
};
|
};
|
||||||
|
const LINEFEED = "\n";
|
||||||
const SLOT_DEFAULT_NAME = "d";
|
const SLOT_DEFAULT_NAME = "d";
|
||||||
const ON_SHOW = "onShow";
|
const ON_SHOW = "onShow";
|
||||||
const ON_HIDE = "onHide";
|
const ON_HIDE = "onHide";
|
||||||
|
@ -620,7 +621,7 @@ function getApiCallbacks(args) {
|
||||||
}
|
}
|
||||||
return apiCallbacks;
|
return apiCallbacks;
|
||||||
}
|
}
|
||||||
function normalizeErrMsg(errMsg, name) {
|
function normalizeErrMsg$1(errMsg, name) {
|
||||||
if (!errMsg || errMsg.indexOf(":fail") === -1) {
|
if (!errMsg || errMsg.indexOf(":fail") === -1) {
|
||||||
return name + ":ok";
|
return name + ":ok";
|
||||||
}
|
}
|
||||||
|
@ -637,7 +638,7 @@ function createAsyncApiCallback(name, args = {}, { beforeAll, beforeSuccess } =
|
||||||
const callbackId = invokeCallbackId++;
|
const callbackId = invokeCallbackId++;
|
||||||
addInvokeCallback(callbackId, name, (res) => {
|
addInvokeCallback(callbackId, name, (res) => {
|
||||||
res = res || {};
|
res = res || {};
|
||||||
res.errMsg = normalizeErrMsg(res.errMsg, name);
|
res.errMsg = normalizeErrMsg$1(res.errMsg, name);
|
||||||
isFunction(beforeAll) && beforeAll(res);
|
isFunction(beforeAll) && beforeAll(res);
|
||||||
if (res.errMsg === name + ":ok") {
|
if (res.errMsg === name + ":ok") {
|
||||||
isFunction(beforeSuccess) && beforeSuccess(res, args);
|
isFunction(beforeSuccess) && beforeSuccess(res, args);
|
||||||
|
@ -769,7 +770,7 @@ function promisify$1(name, fn) {
|
||||||
}
|
}
|
||||||
function formatApiArgs(args, options) {
|
function formatApiArgs(args, options) {
|
||||||
const params = args[0];
|
const params = args[0];
|
||||||
if (!options || !options.formatArgs || !isPlainObject$1(options.formatArgs) && isPlainObject$1(params)) {
|
if (!options || !isPlainObject$1(options.formatArgs) && isPlainObject$1(params)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const formatArgs = options.formatArgs;
|
const formatArgs = options.formatArgs;
|
||||||
|
@ -816,12 +817,12 @@ function beforeInvokeApi(name, args, protocol, options) {
|
||||||
return errMsg;
|
return errMsg;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function parseErrMsg(errMsg) {
|
function normalizeErrMsg(errMsg) {
|
||||||
if (!errMsg || isString(errMsg)) {
|
if (!errMsg || isString(errMsg)) {
|
||||||
return errMsg;
|
return errMsg;
|
||||||
}
|
}
|
||||||
if (errMsg.stack) {
|
if (errMsg.stack) {
|
||||||
console.error(errMsg.message + "\n" + errMsg.stack);
|
console.error(errMsg.message + LINEFEED + errMsg.stack);
|
||||||
return errMsg.message;
|
return errMsg.message;
|
||||||
}
|
}
|
||||||
return errMsg;
|
return errMsg;
|
||||||
|
@ -835,7 +836,7 @@ function wrapperTaskApi(name, fn, protocol, options) {
|
||||||
}
|
}
|
||||||
return fn(args, {
|
return fn(args, {
|
||||||
resolve: (res) => invokeSuccess(id, name, res),
|
resolve: (res) => invokeSuccess(id, name, res),
|
||||||
reject: (errMsg2, errRes) => invokeFail(id, name, parseErrMsg(errMsg2), errRes)
|
reject: (errMsg2, errRes) => invokeFail(id, name, normalizeErrMsg(errMsg2), errRes)
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1297,8 +1298,8 @@ function populateParameters(fromRes, toRes) {
|
||||||
appVersion: "1.0.0",
|
appVersion: "1.0.0",
|
||||||
appVersionCode: "100",
|
appVersionCode: "100",
|
||||||
appLanguage: getAppLanguage(hostLanguage),
|
appLanguage: getAppLanguage(hostLanguage),
|
||||||
uniCompileVersion: "4.23",
|
uniCompileVersion: "4.15",
|
||||||
uniRuntimeVersion: "4.23",
|
uniRuntimeVersion: "4.15",
|
||||||
uniPlatform: "mp-weixin",
|
uniPlatform: "mp-weixin",
|
||||||
deviceBrand,
|
deviceBrand,
|
||||||
deviceModel: model,
|
deviceModel: model,
|
||||||
|
@ -7303,7 +7304,7 @@ function initDefaultProps(options, isBehavior = false) {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
if (options.behaviors) {
|
if (options.behaviors) {
|
||||||
if (options.behaviors.includes("wx://form-field")) {
|
if (options.behaviors.includes("__GLOBAL__://form-field")) {
|
||||||
if (!options.properties || !options.properties.name) {
|
if (!options.properties || !options.properties.name) {
|
||||||
properties.name = {
|
properties.name = {
|
||||||
type: null,
|
type: null,
|
||||||
|
@ -7474,7 +7475,7 @@ function initBehaviors(vueOptions) {
|
||||||
const behaviors = [];
|
const behaviors = [];
|
||||||
if (isArray(vueBehaviors)) {
|
if (isArray(vueBehaviors)) {
|
||||||
vueBehaviors.forEach((behavior) => {
|
vueBehaviors.forEach((behavior) => {
|
||||||
behaviors.push(behavior.replace("uni://", "wx://"));
|
behaviors.push(behavior.replace("uni://", "__GLOBAL__://"));
|
||||||
if (behavior === "uni://form-field") {
|
if (behavior === "uni://form-field") {
|
||||||
if (isArray(vueProps)) {
|
if (isArray(vueProps)) {
|
||||||
vueProps.push("name");
|
vueProps.push("name");
|
||||||
|
|
|
@ -10,5 +10,5 @@ function _sfc_render(_ctx, _cache) {
|
||||||
})
|
})
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-6d058dc0"]]);
|
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-6d058dc0"], ["__file", "D:/jiangchengfeiyi-xiaochengxu/pages/Shopping-cart/Phone/Phone.vue"]]);
|
||||||
wx.createPage(MiniProgramPage);
|
wx.createPage(MiniProgramPage);
|
||||||
|
|
|
@ -72,5 +72,5 @@ const _sfc_main = {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-fb57d854"]]);
|
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-fb57d854"], ["__file", "D:/jiangchengfeiyi-xiaochengxu/pages/Shopping-cart/newaddress_Info/newaddress_Info.vue"]]);
|
||||||
wx.createPage(MiniProgramPage);
|
wx.createPage(MiniProgramPage);
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user