商品详情,待支付页面完成
This commit is contained in:
commit
4f7d1308d1
3
api/request.ts
Normal file
3
api/request.ts
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
export const baseUrl = 'http://localhost:9092/api' //后端接口文档
|
||||||
|
export const testUrl = 'http://123.249.108.160:8888/api' //自己组的服务器接口地址
|
||||||
|
export const suiUrl = 'http://154.8.193.216:9092/api' //隋宇霏的接口地址
|
5
main.js
5
main.js
|
@ -1,8 +1,6 @@
|
||||||
|
|
||||||
// #ifndef VUE3
|
// #ifndef VUE3
|
||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
import App from './App'
|
import App from './App'
|
||||||
|
|
||||||
Vue.config.productionTip = false
|
Vue.config.productionTip = false
|
||||||
|
|
||||||
App.mpType = 'app'
|
App.mpType = 'app'
|
||||||
|
@ -11,13 +9,16 @@ const app = new Vue({
|
||||||
...App
|
...App
|
||||||
})
|
})
|
||||||
app.$mount()
|
app.$mount()
|
||||||
|
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
// #ifdef VUE3
|
// #ifdef VUE3
|
||||||
|
import pinia from './store'
|
||||||
import { createSSRApp } from 'vue'
|
import { createSSRApp } from 'vue'
|
||||||
import App from './App.vue'
|
import App from './App.vue'
|
||||||
export function createApp() {
|
export function createApp() {
|
||||||
const app = createSSRApp(App)
|
const app = createSSRApp(App)
|
||||||
|
app.use(pinia)
|
||||||
return {
|
return {
|
||||||
app
|
app
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,7 +50,7 @@
|
||||||
/* 快应用特有相关 */
|
/* 快应用特有相关 */
|
||||||
"mp-weixin" : {
|
"mp-weixin" : {
|
||||||
/* 小程序特有相关 */
|
/* 小程序特有相关 */
|
||||||
"appid" : "wxbcb1cf9951fa17c8",
|
"appid" : "wx3f968a09e31d6bed",
|
||||||
"setting" : {
|
"setting" : {
|
||||||
"urlCheck" : false
|
"urlCheck" : false
|
||||||
},
|
},
|
||||||
|
|
15
node_modules/.bin/vue-demi-fix
generated
vendored
Normal file
15
node_modules/.bin/vue-demi-fix
generated
vendored
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
#!/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
Normal file
17
node_modules/.bin/vue-demi-fix.cmd
generated
vendored
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
@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
Normal file
18
node_modules/.bin/vue-demi-fix.ps1
generated
vendored
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
#!/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
Normal file
15
node_modules/.bin/vue-demi-switch
generated
vendored
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
#!/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
Normal file
17
node_modules/.bin/vue-demi-switch.cmd
generated
vendored
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
@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
Normal file
18
node_modules/.bin/vue-demi-switch.ps1
generated
vendored
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
#!/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
|
2
node_modules/@vue/devtools-api/lib/cjs/api/api.js
generated
vendored
Normal file
2
node_modules/@vue/devtools-api/lib/cjs/api/api.js
generated
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
"use strict";
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
2
node_modules/@vue/devtools-api/lib/cjs/api/app.js
generated
vendored
Normal file
2
node_modules/@vue/devtools-api/lib/cjs/api/app.js
generated
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
"use strict";
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
2
node_modules/@vue/devtools-api/lib/cjs/api/component.js
generated
vendored
Normal file
2
node_modules/@vue/devtools-api/lib/cjs/api/component.js
generated
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
"use strict";
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
2
node_modules/@vue/devtools-api/lib/cjs/api/context.js
generated
vendored
Normal file
2
node_modules/@vue/devtools-api/lib/cjs/api/context.js
generated
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
"use strict";
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
2
node_modules/@vue/devtools-api/lib/cjs/api/hooks.js
generated
vendored
Normal file
2
node_modules/@vue/devtools-api/lib/cjs/api/hooks.js
generated
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
"use strict";
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
22
node_modules/@vue/devtools-api/lib/cjs/api/index.js
generated
vendored
Normal file
22
node_modules/@vue/devtools-api/lib/cjs/api/index.js
generated
vendored
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
"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
Normal file
2
node_modules/@vue/devtools-api/lib/cjs/api/util.js
generated
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
"use strict";
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
5
node_modules/@vue/devtools-api/lib/cjs/const.js
generated
vendored
Normal file
5
node_modules/@vue/devtools-api/lib/cjs/const.js
generated
vendored
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
"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
Normal file
17
node_modules/@vue/devtools-api/lib/cjs/env.js
generated
vendored
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
"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
Normal file
45
node_modules/@vue/devtools-api/lib/cjs/index.js
generated
vendored
Normal file
|
@ -0,0 +1,45 @@
|
||||||
|
"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
Normal file
2
node_modules/@vue/devtools-api/lib/cjs/plugin.js
generated
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
"use strict";
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
111
node_modules/@vue/devtools-api/lib/cjs/proxy.js
generated
vendored
Normal file
111
node_modules/@vue/devtools-api/lib/cjs/proxy.js
generated
vendored
Normal file
|
@ -0,0 +1,111 @@
|
||||||
|
"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
Normal file
28
node_modules/@vue/devtools-api/lib/cjs/time.js
generated
vendored
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
"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
Normal file
108
node_modules/@vue/devtools-api/lib/esm/api/api.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,108 @@
|
||||||
|
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
Normal file
1
node_modules/@vue/devtools-api/lib/esm/api/api.js
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
export {};
|
1
node_modules/@vue/devtools-api/lib/esm/api/app.d.ts
generated
vendored
Normal file
1
node_modules/@vue/devtools-api/lib/esm/api/app.d.ts
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
export type App = any;
|
1
node_modules/@vue/devtools-api/lib/esm/api/app.js
generated
vendored
Normal file
1
node_modules/@vue/devtools-api/lib/esm/api/app.js
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
export {};
|
78
node_modules/@vue/devtools-api/lib/esm/api/component.d.ts
generated
vendored
Normal file
78
node_modules/@vue/devtools-api/lib/esm/api/component.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,78 @@
|
||||||
|
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
Normal file
1
node_modules/@vue/devtools-api/lib/esm/api/component.js
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
export {};
|
5
node_modules/@vue/devtools-api/lib/esm/api/context.d.ts
generated
vendored
Normal file
5
node_modules/@vue/devtools-api/lib/esm/api/context.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
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
Normal file
1
node_modules/@vue/devtools-api/lib/esm/api/context.js
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
export {};
|
180
node_modules/@vue/devtools-api/lib/esm/api/hooks.d.ts
generated
vendored
Normal file
180
node_modules/@vue/devtools-api/lib/esm/api/hooks.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,180 @@
|
||||||
|
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
Normal file
1
node_modules/@vue/devtools-api/lib/esm/api/hooks.js
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
export {};
|
6
node_modules/@vue/devtools-api/lib/esm/api/index.d.ts
generated
vendored
Normal file
6
node_modules/@vue/devtools-api/lib/esm/api/index.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
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
Normal file
6
node_modules/@vue/devtools-api/lib/esm/api/index.js
generated
vendored
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
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
Normal file
4
node_modules/@vue/devtools-api/lib/esm/api/util.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
export type ID = number | string;
|
||||||
|
export interface WithId {
|
||||||
|
id: ID;
|
||||||
|
}
|
1
node_modules/@vue/devtools-api/lib/esm/api/util.js
generated
vendored
Normal file
1
node_modules/@vue/devtools-api/lib/esm/api/util.js
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
export {};
|
2
node_modules/@vue/devtools-api/lib/esm/const.d.ts
generated
vendored
Normal file
2
node_modules/@vue/devtools-api/lib/esm/const.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
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
Normal file
2
node_modules/@vue/devtools-api/lib/esm/const.js
generated
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
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
Normal file
15
node_modules/@vue/devtools-api/lib/esm/env.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
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
Normal file
12
node_modules/@vue/devtools-api/lib/esm/env.js
generated
vendored
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
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
Normal file
18
node_modules/@vue/devtools-api/lib/esm/index.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
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
Normal file
27
node_modules/@vue/devtools-api/lib/esm/index.js
generated
vendored
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
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
Normal file
47
node_modules/@vue/devtools-api/lib/esm/plugin.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
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
Normal file
1
node_modules/@vue/devtools-api/lib/esm/plugin.js
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
export {};
|
20
node_modules/@vue/devtools-api/lib/esm/proxy.d.ts
generated
vendored
Normal file
20
node_modules/@vue/devtools-api/lib/esm/proxy.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
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
Normal file
107
node_modules/@vue/devtools-api/lib/esm/proxy.js
generated
vendored
Normal file
|
@ -0,0 +1,107 @@
|
||||||
|
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
Normal file
2
node_modules/@vue/devtools-api/lib/esm/time.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
export declare function isPerformanceSupported(): boolean;
|
||||||
|
export declare function now(): number;
|
23
node_modules/@vue/devtools-api/lib/esm/time.js
generated
vendored
Normal file
23
node_modules/@vue/devtools-api/lib/esm/time.js
generated
vendored
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
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
Normal file
67
node_modules/@vue/devtools-api/package.json
generated
vendored
Normal file
|
@ -0,0 +1,67 @@
|
||||||
|
{
|
||||||
|
"_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"
|
||||||
|
}
|
21
node_modules/mitt/LICENSE
generated
vendored
Normal file
21
node_modules/mitt/LICENSE
generated
vendored
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2021 Jason Miller
|
||||||
|
|
||||||
|
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.
|
205
node_modules/mitt/README.md
generated
vendored
Normal file
205
node_modules/mitt/README.md
generated
vendored
Normal file
|
@ -0,0 +1,205 @@
|
||||||
|
<p align="center">
|
||||||
|
<img src="https://i.imgur.com/BqsX9NT.png" width="300" height="300" alt="mitt">
|
||||||
|
<br>
|
||||||
|
<a href="https://www.npmjs.org/package/mitt"><img src="https://img.shields.io/npm/v/mitt.svg" alt="npm"></a>
|
||||||
|
<img src="https://github.com/developit/mitt/workflows/CI/badge.svg" alt="build status">
|
||||||
|
<a href="https://unpkg.com/mitt/dist/mitt.js"><img src="https://img.badgesize.io/https://unpkg.com/mitt/dist/mitt.js?compression=gzip" alt="gzip size"></a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
# Mitt
|
||||||
|
|
||||||
|
> Tiny 200b functional event emitter / pubsub.
|
||||||
|
|
||||||
|
- **Microscopic:** weighs less than 200 bytes gzipped
|
||||||
|
- **Useful:** a wildcard `"*"` event type listens to all events
|
||||||
|
- **Familiar:** same names & ideas as [Node's EventEmitter](https://nodejs.org/api/events.html#events_class_eventemitter)
|
||||||
|
- **Functional:** methods don't rely on `this`
|
||||||
|
- **Great Name:** somehow [mitt](https://npm.im/mitt) wasn't taken
|
||||||
|
|
||||||
|
Mitt was made for the browser, but works in any JavaScript runtime. It has no dependencies and supports IE9+.
|
||||||
|
|
||||||
|
## Table of Contents
|
||||||
|
|
||||||
|
- [Install](#install)
|
||||||
|
- [Usage](#usage)
|
||||||
|
- [Examples & Demos](#examples--demos)
|
||||||
|
- [API](#api)
|
||||||
|
- [Contribute](#contribute)
|
||||||
|
- [License](#license)
|
||||||
|
|
||||||
|
## Install
|
||||||
|
|
||||||
|
This project uses [node](http://nodejs.org) and [npm](https://npmjs.com). Go check them out if you don't have them locally installed.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ npm install --save mitt
|
||||||
|
```
|
||||||
|
|
||||||
|
Then with a module bundler like [rollup](http://rollupjs.org/) or [webpack](https://webpack.js.org/), use as you would anything else:
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
// using ES6 modules
|
||||||
|
import mitt from 'mitt'
|
||||||
|
|
||||||
|
// using CommonJS modules
|
||||||
|
var mitt = require('mitt')
|
||||||
|
```
|
||||||
|
|
||||||
|
The [UMD](https://github.com/umdjs/umd) build is also available on [unpkg](https://unpkg.com):
|
||||||
|
|
||||||
|
```html
|
||||||
|
<script src="https://unpkg.com/mitt/dist/mitt.umd.js"></script>
|
||||||
|
```
|
||||||
|
|
||||||
|
You can find the library on `window.mitt`.
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
```js
|
||||||
|
import mitt from 'mitt'
|
||||||
|
|
||||||
|
const emitter = mitt()
|
||||||
|
|
||||||
|
// listen to an event
|
||||||
|
emitter.on('foo', e => console.log('foo', e) )
|
||||||
|
|
||||||
|
// listen to all events
|
||||||
|
emitter.on('*', (type, e) => console.log(type, e) )
|
||||||
|
|
||||||
|
// fire an event
|
||||||
|
emitter.emit('foo', { a: 'b' })
|
||||||
|
|
||||||
|
// clearing all events
|
||||||
|
emitter.all.clear()
|
||||||
|
|
||||||
|
// working with handler references:
|
||||||
|
function onFoo() {}
|
||||||
|
emitter.on('foo', onFoo) // listen
|
||||||
|
emitter.off('foo', onFoo) // unlisten
|
||||||
|
```
|
||||||
|
|
||||||
|
### Typescript
|
||||||
|
|
||||||
|
Set `"strict": true` in your tsconfig.json to get improved type inference for `mitt` instance methods.
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import mitt from 'mitt';
|
||||||
|
|
||||||
|
type Events = {
|
||||||
|
foo: string;
|
||||||
|
bar?: number;
|
||||||
|
};
|
||||||
|
|
||||||
|
const emitter = mitt<Events>(); // inferred as Emitter<Events>
|
||||||
|
|
||||||
|
emitter.on('foo', (e) => {}); // 'e' has inferred type 'string'
|
||||||
|
|
||||||
|
emitter.emit('foo', 42); // Error: Argument of type 'number' is not assignable to parameter of type 'string'. (2345)
|
||||||
|
```
|
||||||
|
|
||||||
|
Alternatively, you can use the provided `Emitter` type:
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import mitt, { Emitter } from 'mitt';
|
||||||
|
|
||||||
|
type Events = {
|
||||||
|
foo: string;
|
||||||
|
bar?: number;
|
||||||
|
};
|
||||||
|
|
||||||
|
const emitter: Emitter<Events> = mitt<Events>();
|
||||||
|
```
|
||||||
|
|
||||||
|
## Examples & Demos
|
||||||
|
|
||||||
|
<a href="http://codepen.io/developit/pen/rjMEwW?editors=0110">
|
||||||
|
<b>Preact + Mitt Codepen Demo</b>
|
||||||
|
<br>
|
||||||
|
<img src="https://i.imgur.com/CjBgOfJ.png" width="278" alt="preact + mitt preview">
|
||||||
|
</a>
|
||||||
|
|
||||||
|
* * *
|
||||||
|
|
||||||
|
## API
|
||||||
|
|
||||||
|
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
|
||||||
|
|
||||||
|
#### Table of Contents
|
||||||
|
|
||||||
|
- [mitt](#mitt)
|
||||||
|
- [all](#all)
|
||||||
|
- [on](#on)
|
||||||
|
- [Parameters](#parameters)
|
||||||
|
- [off](#off)
|
||||||
|
- [Parameters](#parameters-1)
|
||||||
|
- [emit](#emit)
|
||||||
|
- [Parameters](#parameters-2)
|
||||||
|
|
||||||
|
### mitt
|
||||||
|
|
||||||
|
Mitt: Tiny (~200b) functional event emitter / pubsub.
|
||||||
|
|
||||||
|
Returns **Mitt**
|
||||||
|
|
||||||
|
### all
|
||||||
|
|
||||||
|
A Map of event names to registered handler functions.
|
||||||
|
|
||||||
|
### on
|
||||||
|
|
||||||
|
Register an event handler for the given type.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
|
||||||
|
- `type` **([string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) \| [symbol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol))** Type of event to listen for, or `'*'` for all events
|
||||||
|
- `handler` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)** Function to call in response to given event
|
||||||
|
|
||||||
|
### off
|
||||||
|
|
||||||
|
Remove an event handler for the given type.
|
||||||
|
If `handler` is omitted, all handlers of the given type are removed.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
|
||||||
|
- `type` **([string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) \| [symbol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol))** Type of event to unregister `handler` from, or `'*'`
|
||||||
|
- `handler` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)?** Handler function to remove
|
||||||
|
|
||||||
|
### emit
|
||||||
|
|
||||||
|
Invoke all handlers for the given type.
|
||||||
|
If present, `'*'` handlers are invoked after type-matched handlers.
|
||||||
|
|
||||||
|
Note: Manually firing '\*' handlers is not supported.
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
|
||||||
|
- `type` **([string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) \| [symbol](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol))** The event type to invoke
|
||||||
|
- `evt` **Any?** Any value (object is recommended and powerful), passed to each handler
|
||||||
|
|
||||||
|
## Contribute
|
||||||
|
|
||||||
|
First off, thanks for taking the time to contribute!
|
||||||
|
Now, take a moment to be sure your contributions make sense to everyone else.
|
||||||
|
|
||||||
|
### Reporting Issues
|
||||||
|
|
||||||
|
Found a problem? Want a new feature? First of all see if your issue or idea has [already been reported](../../issues).
|
||||||
|
If don't, just open a [new clear and descriptive issue](../../issues/new).
|
||||||
|
|
||||||
|
### Submitting pull requests
|
||||||
|
|
||||||
|
Pull requests are the greatest contributions, so be sure they are focused in scope, and do avoid unrelated commits.
|
||||||
|
|
||||||
|
- Fork it!
|
||||||
|
- Clone your fork: `git clone https://github.com/<your-username>/mitt`
|
||||||
|
- Navigate to the newly cloned directory: `cd mitt`
|
||||||
|
- Create a new branch for the new feature: `git checkout -b my-new-feature`
|
||||||
|
- Install the tools necessary for development: `npm install`
|
||||||
|
- Make your changes.
|
||||||
|
- Commit your changes: `git commit -am 'Add some feature'`
|
||||||
|
- Push to the branch: `git push origin my-new-feature`
|
||||||
|
- Submit a pull request with full remarks documenting your changes.
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
[MIT License](https://opensource.org/licenses/MIT) © [Jason Miller](https://jasonformat.com/)
|
2
node_modules/mitt/dist/mitt.js
generated
vendored
Normal file
2
node_modules/mitt/dist/mitt.js
generated
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
module.exports=function(n){return{all:n=n||new Map,on:function(e,t){var i=n.get(e);i?i.push(t):n.set(e,[t])},off:function(e,t){var i=n.get(e);i&&(t?i.splice(i.indexOf(t)>>>0,1):n.set(e,[]))},emit:function(e,t){var i=n.get(e);i&&i.slice().map(function(n){n(t)}),(i=n.get("*"))&&i.slice().map(function(n){n(e,t)})}}};
|
||||||
|
//# sourceMappingURL=mitt.js.map
|
1
node_modules/mitt/dist/mitt.js.map
generated
vendored
Normal file
1
node_modules/mitt/dist/mitt.js.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
{"version":3,"file":"mitt.js","sources":["../src/index.ts"],"sourcesContent":["export type EventType = string | symbol;\n\n// An event handler can take an optional event argument\n// and should not return a value\nexport type Handler<T = unknown> = (event: T) => void;\nexport type WildcardHandler<T = Record<string, unknown>> = (\n\ttype: keyof T,\n\tevent: T[keyof T]\n) => void;\n\n// An array of all currently registered event handlers for a type\nexport type EventHandlerList<T = unknown> = Array<Handler<T>>;\nexport type WildCardEventHandlerList<T = Record<string, unknown>> = Array<\n\tWildcardHandler<T>\n>;\n\n// A map of event types and their corresponding event handlers.\nexport type EventHandlerMap<Events extends Record<EventType, unknown>> = Map<\n\tkeyof Events | '*',\n\tEventHandlerList<Events[keyof Events]> | WildCardEventHandlerList<Events>\n>;\n\nexport interface Emitter<Events extends Record<EventType, unknown>> {\n\tall: EventHandlerMap<Events>;\n\n\ton<Key extends keyof Events>(type: Key, handler: Handler<Events[Key]>): void;\n\ton(type: '*', handler: WildcardHandler<Events>): void;\n\n\toff<Key extends keyof Events>(\n\t\ttype: Key,\n\t\thandler?: Handler<Events[Key]>\n\t): void;\n\toff(type: '*', handler: WildcardHandler<Events>): void;\n\n\temit<Key extends keyof Events>(type: Key, event: Events[Key]): void;\n\temit<Key extends keyof Events>(\n\t\ttype: undefined extends Events[Key] ? Key : never\n\t): void;\n}\n\n/**\n * Mitt: Tiny (~200b) functional event emitter / pubsub.\n * @name mitt\n * @returns {Mitt}\n */\nexport default function mitt<Events extends Record<EventType, unknown>>(\n\tall?: EventHandlerMap<Events>\n): Emitter<Events> {\n\ttype GenericEventHandler =\n\t\t| Handler<Events[keyof Events]>\n\t\t| WildcardHandler<Events>;\n\tall = all || new Map();\n\n\treturn {\n\t\t/**\n\t\t * A Map of event names to registered handler functions.\n\t\t */\n\t\tall,\n\n\t\t/**\n\t\t * Register an event handler for the given type.\n\t\t * @param {string|symbol} type Type of event to listen for, or `'*'` for all events\n\t\t * @param {Function} handler Function to call in response to given event\n\t\t * @memberOf mitt\n\t\t */\n\t\ton<Key extends keyof Events>(type: Key, handler: GenericEventHandler) {\n\t\t\tconst handlers: Array<GenericEventHandler> | undefined = all!.get(type);\n\t\t\tif (handlers) {\n\t\t\t\thandlers.push(handler);\n\t\t\t} else {\n\t\t\t\tall!.set(type, [handler] as EventHandlerList<Events[keyof Events]>);\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Remove an event handler for the given type.\n\t\t * If `handler` is omitted, all handlers of the given type are removed.\n\t\t * @param {string|symbol} type Type of event to unregister `handler` from (`'*'` to remove a wildcard handler)\n\t\t * @param {Function} [handler] Handler function to remove\n\t\t * @memberOf mitt\n\t\t */\n\t\toff<Key extends keyof Events>(type: Key, handler?: GenericEventHandler) {\n\t\t\tconst handlers: Array<GenericEventHandler> | undefined = all!.get(type);\n\t\t\tif (handlers) {\n\t\t\t\tif (handler) {\n\t\t\t\t\thandlers.splice(handlers.indexOf(handler) >>> 0, 1);\n\t\t\t\t} else {\n\t\t\t\t\tall!.set(type, []);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Invoke all handlers for the given type.\n\t\t * If present, `'*'` handlers are invoked after type-matched handlers.\n\t\t *\n\t\t * Note: Manually firing '*' handlers is not supported.\n\t\t *\n\t\t * @param {string|symbol} type The event type to invoke\n\t\t * @param {Any} [evt] Any value (object is recommended and powerful), passed to each handler\n\t\t * @memberOf mitt\n\t\t */\n\t\temit<Key extends keyof Events>(type: Key, evt?: Events[Key]) {\n\t\t\tlet handlers = all!.get(type);\n\t\t\tif (handlers) {\n\t\t\t\t(handlers as EventHandlerList<Events[keyof Events]>)\n\t\t\t\t\t.slice()\n\t\t\t\t\t.map((handler) => {\n\t\t\t\t\t\thandler(evt!);\n\t\t\t\t\t});\n\t\t\t}\n\n\t\t\thandlers = all!.get('*');\n\t\t\tif (handlers) {\n\t\t\t\t(handlers as WildCardEventHandlerList<Events>)\n\t\t\t\t\t.slice()\n\t\t\t\t\t.map((handler) => {\n\t\t\t\t\t\thandler(type, evt!);\n\t\t\t\t\t});\n\t\t\t}\n\t\t}\n\t};\n}\n"],"names":["all","Map","on","type","handler","handlers","get","push","set","off","splice","indexOf","emit","evt","slice","map"],"mappings":"wBA8CCA,GAOA,MAAO,CAINA,IANDA,EAAMA,GAAO,IAAIC,IAchBC,YAA6BC,EAAWC,GACvC,IAAMC,EAAmDL,EAAKM,IAAIH,GAC9DE,EACHA,EAASE,KAAKH,GAEdJ,EAAKQ,IAAIL,EAAM,CAACC,KAWlBK,aAA8BN,EAAWC,GACxC,IAAMC,EAAmDL,EAAKM,IAAIH,GAC9DE,IACCD,EACHC,EAASK,OAAOL,EAASM,QAAQP,KAAa,EAAG,GAEjDJ,EAAKQ,IAAIL,EAAM,MAelBS,cAA+BT,EAAWU,GACzC,IAAIR,EAAWL,EAAKM,IAAIH,GACpBE,GACFA,EACCS,QACAC,IAAI,SAACX,GACLA,EAAQS,MAIXR,EAAWL,EAAKM,IAAI,OAElBD,EACCS,QACAC,IAAI,SAACX,GACLA,EAAQD,EAAMU"}
|
2
node_modules/mitt/dist/mitt.mjs
generated
vendored
Normal file
2
node_modules/mitt/dist/mitt.mjs
generated
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
export default function(n){return{all:n=n||new Map,on:function(t,e){var i=n.get(t);i?i.push(e):n.set(t,[e])},off:function(t,e){var i=n.get(t);i&&(e?i.splice(i.indexOf(e)>>>0,1):n.set(t,[]))},emit:function(t,e){var i=n.get(t);i&&i.slice().map(function(n){n(e)}),(i=n.get("*"))&&i.slice().map(function(n){n(t,e)})}}}
|
||||||
|
//# sourceMappingURL=mitt.mjs.map
|
1
node_modules/mitt/dist/mitt.mjs.map
generated
vendored
Normal file
1
node_modules/mitt/dist/mitt.mjs.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
{"version":3,"file":"mitt.mjs","sources":["../src/index.ts"],"sourcesContent":["export type EventType = string | symbol;\n\n// An event handler can take an optional event argument\n// and should not return a value\nexport type Handler<T = unknown> = (event: T) => void;\nexport type WildcardHandler<T = Record<string, unknown>> = (\n\ttype: keyof T,\n\tevent: T[keyof T]\n) => void;\n\n// An array of all currently registered event handlers for a type\nexport type EventHandlerList<T = unknown> = Array<Handler<T>>;\nexport type WildCardEventHandlerList<T = Record<string, unknown>> = Array<\n\tWildcardHandler<T>\n>;\n\n// A map of event types and their corresponding event handlers.\nexport type EventHandlerMap<Events extends Record<EventType, unknown>> = Map<\n\tkeyof Events | '*',\n\tEventHandlerList<Events[keyof Events]> | WildCardEventHandlerList<Events>\n>;\n\nexport interface Emitter<Events extends Record<EventType, unknown>> {\n\tall: EventHandlerMap<Events>;\n\n\ton<Key extends keyof Events>(type: Key, handler: Handler<Events[Key]>): void;\n\ton(type: '*', handler: WildcardHandler<Events>): void;\n\n\toff<Key extends keyof Events>(\n\t\ttype: Key,\n\t\thandler?: Handler<Events[Key]>\n\t): void;\n\toff(type: '*', handler: WildcardHandler<Events>): void;\n\n\temit<Key extends keyof Events>(type: Key, event: Events[Key]): void;\n\temit<Key extends keyof Events>(\n\t\ttype: undefined extends Events[Key] ? Key : never\n\t): void;\n}\n\n/**\n * Mitt: Tiny (~200b) functional event emitter / pubsub.\n * @name mitt\n * @returns {Mitt}\n */\nexport default function mitt<Events extends Record<EventType, unknown>>(\n\tall?: EventHandlerMap<Events>\n): Emitter<Events> {\n\ttype GenericEventHandler =\n\t\t| Handler<Events[keyof Events]>\n\t\t| WildcardHandler<Events>;\n\tall = all || new Map();\n\n\treturn {\n\t\t/**\n\t\t * A Map of event names to registered handler functions.\n\t\t */\n\t\tall,\n\n\t\t/**\n\t\t * Register an event handler for the given type.\n\t\t * @param {string|symbol} type Type of event to listen for, or `'*'` for all events\n\t\t * @param {Function} handler Function to call in response to given event\n\t\t * @memberOf mitt\n\t\t */\n\t\ton<Key extends keyof Events>(type: Key, handler: GenericEventHandler) {\n\t\t\tconst handlers: Array<GenericEventHandler> | undefined = all!.get(type);\n\t\t\tif (handlers) {\n\t\t\t\thandlers.push(handler);\n\t\t\t} else {\n\t\t\t\tall!.set(type, [handler] as EventHandlerList<Events[keyof Events]>);\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Remove an event handler for the given type.\n\t\t * If `handler` is omitted, all handlers of the given type are removed.\n\t\t * @param {string|symbol} type Type of event to unregister `handler` from (`'*'` to remove a wildcard handler)\n\t\t * @param {Function} [handler] Handler function to remove\n\t\t * @memberOf mitt\n\t\t */\n\t\toff<Key extends keyof Events>(type: Key, handler?: GenericEventHandler) {\n\t\t\tconst handlers: Array<GenericEventHandler> | undefined = all!.get(type);\n\t\t\tif (handlers) {\n\t\t\t\tif (handler) {\n\t\t\t\t\thandlers.splice(handlers.indexOf(handler) >>> 0, 1);\n\t\t\t\t} else {\n\t\t\t\t\tall!.set(type, []);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Invoke all handlers for the given type.\n\t\t * If present, `'*'` handlers are invoked after type-matched handlers.\n\t\t *\n\t\t * Note: Manually firing '*' handlers is not supported.\n\t\t *\n\t\t * @param {string|symbol} type The event type to invoke\n\t\t * @param {Any} [evt] Any value (object is recommended and powerful), passed to each handler\n\t\t * @memberOf mitt\n\t\t */\n\t\temit<Key extends keyof Events>(type: Key, evt?: Events[Key]) {\n\t\t\tlet handlers = all!.get(type);\n\t\t\tif (handlers) {\n\t\t\t\t(handlers as EventHandlerList<Events[keyof Events]>)\n\t\t\t\t\t.slice()\n\t\t\t\t\t.map((handler) => {\n\t\t\t\t\t\thandler(evt!);\n\t\t\t\t\t});\n\t\t\t}\n\n\t\t\thandlers = all!.get('*');\n\t\t\tif (handlers) {\n\t\t\t\t(handlers as WildCardEventHandlerList<Events>)\n\t\t\t\t\t.slice()\n\t\t\t\t\t.map((handler) => {\n\t\t\t\t\t\thandler(type, evt!);\n\t\t\t\t\t});\n\t\t\t}\n\t\t}\n\t};\n}\n"],"names":["all","Map","on","type","handler","handlers","get","push","set","off","splice","indexOf","emit","evt","slice","map"],"mappings":"wBA8CCA,GAOA,MAAO,CAINA,IANDA,EAAMA,GAAO,IAAIC,IAchBC,YAA6BC,EAAWC,GACvC,IAAMC,EAAmDL,EAAKM,IAAIH,GAC9DE,EACHA,EAASE,KAAKH,GAEdJ,EAAKQ,IAAIL,EAAM,CAACC,KAWlBK,aAA8BN,EAAWC,GACxC,IAAMC,EAAmDL,EAAKM,IAAIH,GAC9DE,IACCD,EACHC,EAASK,OAAOL,EAASM,QAAQP,KAAa,EAAG,GAEjDJ,EAAKQ,IAAIL,EAAM,MAelBS,cAA+BT,EAAWU,GACzC,IAAIR,EAAWL,EAAKM,IAAIH,GACpBE,GACFA,EACCS,QACAC,IAAI,SAACX,GACLA,EAAQS,MAIXR,EAAWL,EAAKM,IAAI,OAElBD,EACCS,QACAC,IAAI,SAACX,GACLA,EAAQD,EAAMU"}
|
2
node_modules/mitt/dist/mitt.umd.js
generated
vendored
Normal file
2
node_modules/mitt/dist/mitt.umd.js
generated
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e=e||self).mitt=n()}(this,function(){return function(e){return{all:e=e||new Map,on:function(n,t){var f=e.get(n);f?f.push(t):e.set(n,[t])},off:function(n,t){var f=e.get(n);f&&(t?f.splice(f.indexOf(t)>>>0,1):e.set(n,[]))},emit:function(n,t){var f=e.get(n);f&&f.slice().map(function(e){e(t)}),(f=e.get("*"))&&f.slice().map(function(e){e(n,t)})}}}});
|
||||||
|
//# sourceMappingURL=mitt.umd.js.map
|
1
node_modules/mitt/dist/mitt.umd.js.map
generated
vendored
Normal file
1
node_modules/mitt/dist/mitt.umd.js.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
{"version":3,"file":"mitt.umd.js","sources":["../src/index.ts"],"sourcesContent":["export type EventType = string | symbol;\n\n// An event handler can take an optional event argument\n// and should not return a value\nexport type Handler<T = unknown> = (event: T) => void;\nexport type WildcardHandler<T = Record<string, unknown>> = (\n\ttype: keyof T,\n\tevent: T[keyof T]\n) => void;\n\n// An array of all currently registered event handlers for a type\nexport type EventHandlerList<T = unknown> = Array<Handler<T>>;\nexport type WildCardEventHandlerList<T = Record<string, unknown>> = Array<\n\tWildcardHandler<T>\n>;\n\n// A map of event types and their corresponding event handlers.\nexport type EventHandlerMap<Events extends Record<EventType, unknown>> = Map<\n\tkeyof Events | '*',\n\tEventHandlerList<Events[keyof Events]> | WildCardEventHandlerList<Events>\n>;\n\nexport interface Emitter<Events extends Record<EventType, unknown>> {\n\tall: EventHandlerMap<Events>;\n\n\ton<Key extends keyof Events>(type: Key, handler: Handler<Events[Key]>): void;\n\ton(type: '*', handler: WildcardHandler<Events>): void;\n\n\toff<Key extends keyof Events>(\n\t\ttype: Key,\n\t\thandler?: Handler<Events[Key]>\n\t): void;\n\toff(type: '*', handler: WildcardHandler<Events>): void;\n\n\temit<Key extends keyof Events>(type: Key, event: Events[Key]): void;\n\temit<Key extends keyof Events>(\n\t\ttype: undefined extends Events[Key] ? Key : never\n\t): void;\n}\n\n/**\n * Mitt: Tiny (~200b) functional event emitter / pubsub.\n * @name mitt\n * @returns {Mitt}\n */\nexport default function mitt<Events extends Record<EventType, unknown>>(\n\tall?: EventHandlerMap<Events>\n): Emitter<Events> {\n\ttype GenericEventHandler =\n\t\t| Handler<Events[keyof Events]>\n\t\t| WildcardHandler<Events>;\n\tall = all || new Map();\n\n\treturn {\n\t\t/**\n\t\t * A Map of event names to registered handler functions.\n\t\t */\n\t\tall,\n\n\t\t/**\n\t\t * Register an event handler for the given type.\n\t\t * @param {string|symbol} type Type of event to listen for, or `'*'` for all events\n\t\t * @param {Function} handler Function to call in response to given event\n\t\t * @memberOf mitt\n\t\t */\n\t\ton<Key extends keyof Events>(type: Key, handler: GenericEventHandler) {\n\t\t\tconst handlers: Array<GenericEventHandler> | undefined = all!.get(type);\n\t\t\tif (handlers) {\n\t\t\t\thandlers.push(handler);\n\t\t\t} else {\n\t\t\t\tall!.set(type, [handler] as EventHandlerList<Events[keyof Events]>);\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Remove an event handler for the given type.\n\t\t * If `handler` is omitted, all handlers of the given type are removed.\n\t\t * @param {string|symbol} type Type of event to unregister `handler` from (`'*'` to remove a wildcard handler)\n\t\t * @param {Function} [handler] Handler function to remove\n\t\t * @memberOf mitt\n\t\t */\n\t\toff<Key extends keyof Events>(type: Key, handler?: GenericEventHandler) {\n\t\t\tconst handlers: Array<GenericEventHandler> | undefined = all!.get(type);\n\t\t\tif (handlers) {\n\t\t\t\tif (handler) {\n\t\t\t\t\thandlers.splice(handlers.indexOf(handler) >>> 0, 1);\n\t\t\t\t} else {\n\t\t\t\t\tall!.set(type, []);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Invoke all handlers for the given type.\n\t\t * If present, `'*'` handlers are invoked after type-matched handlers.\n\t\t *\n\t\t * Note: Manually firing '*' handlers is not supported.\n\t\t *\n\t\t * @param {string|symbol} type The event type to invoke\n\t\t * @param {Any} [evt] Any value (object is recommended and powerful), passed to each handler\n\t\t * @memberOf mitt\n\t\t */\n\t\temit<Key extends keyof Events>(type: Key, evt?: Events[Key]) {\n\t\t\tlet handlers = all!.get(type);\n\t\t\tif (handlers) {\n\t\t\t\t(handlers as EventHandlerList<Events[keyof Events]>)\n\t\t\t\t\t.slice()\n\t\t\t\t\t.map((handler) => {\n\t\t\t\t\t\thandler(evt!);\n\t\t\t\t\t});\n\t\t\t}\n\n\t\t\thandlers = all!.get('*');\n\t\t\tif (handlers) {\n\t\t\t\t(handlers as WildCardEventHandlerList<Events>)\n\t\t\t\t\t.slice()\n\t\t\t\t\t.map((handler) => {\n\t\t\t\t\t\thandler(type, evt!);\n\t\t\t\t\t});\n\t\t\t}\n\t\t}\n\t};\n}\n"],"names":["all","Map","on","type","handler","handlers","get","push","set","off","splice","indexOf","emit","evt","slice","map"],"mappings":"6LA8CCA,GAOA,MAAO,CAINA,IANDA,EAAMA,GAAO,IAAIC,IAchBC,YAA6BC,EAAWC,GACvC,IAAMC,EAAmDL,EAAKM,IAAIH,GAC9DE,EACHA,EAASE,KAAKH,GAEdJ,EAAKQ,IAAIL,EAAM,CAACC,KAWlBK,aAA8BN,EAAWC,GACxC,IAAMC,EAAmDL,EAAKM,IAAIH,GAC9DE,IACCD,EACHC,EAASK,OAAOL,EAASM,QAAQP,KAAa,EAAG,GAEjDJ,EAAKQ,IAAIL,EAAM,MAelBS,cAA+BT,EAAWU,GACzC,IAAIR,EAAWL,EAAKM,IAAIH,GACpBE,GACFA,EACCS,QACAC,IAAI,SAACX,GACLA,EAAQS,MAIXR,EAAWL,EAAKM,IAAI,OAElBD,EACCS,QACAC,IAAI,SAACX,GACLA,EAAQD,EAAMU"}
|
21
node_modules/mitt/index.d.ts
generated
vendored
Normal file
21
node_modules/mitt/index.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
export declare type EventType = string | symbol;
|
||||||
|
export declare type Handler<T = unknown> = (event: T) => void;
|
||||||
|
export declare type WildcardHandler<T = Record<string, unknown>> = (type: keyof T, event: T[keyof T]) => void;
|
||||||
|
export declare type EventHandlerList<T = unknown> = Array<Handler<T>>;
|
||||||
|
export declare type WildCardEventHandlerList<T = Record<string, unknown>> = Array<WildcardHandler<T>>;
|
||||||
|
export declare type EventHandlerMap<Events extends Record<EventType, unknown>> = Map<keyof Events | '*', EventHandlerList<Events[keyof Events]> | WildCardEventHandlerList<Events>>;
|
||||||
|
export interface Emitter<Events extends Record<EventType, unknown>> {
|
||||||
|
all: EventHandlerMap<Events>;
|
||||||
|
on<Key extends keyof Events>(type: Key, handler: Handler<Events[Key]>): void;
|
||||||
|
on(type: '*', handler: WildcardHandler<Events>): void;
|
||||||
|
off<Key extends keyof Events>(type: Key, handler?: Handler<Events[Key]>): void;
|
||||||
|
off(type: '*', handler: WildcardHandler<Events>): void;
|
||||||
|
emit<Key extends keyof Events>(type: Key, event: Events[Key]): void;
|
||||||
|
emit<Key extends keyof Events>(type: undefined extends Events[Key] ? Key : never): void;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Mitt: Tiny (~200b) functional event emitter / pubsub.
|
||||||
|
* @name mitt
|
||||||
|
* @returns {Mitt}
|
||||||
|
*/
|
||||||
|
export default function mitt<Events extends Record<EventType, unknown>>(all?: EventHandlerMap<Events>): Emitter<Events>;
|
117
node_modules/mitt/package.json
generated
vendored
Normal file
117
node_modules/mitt/package.json
generated
vendored
Normal file
|
@ -0,0 +1,117 @@
|
||||||
|
{
|
||||||
|
"_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",
|
||||||
|
"escapedName": "mitt",
|
||||||
|
"rawSpec": "",
|
||||||
|
"saveSpec": null,
|
||||||
|
"fetchSpec": "latest"
|
||||||
|
},
|
||||||
|
"_requiredBy": [
|
||||||
|
"#USER",
|
||||||
|
"/"
|
||||||
|
],
|
||||||
|
"_resolved": "https://registry.npmmirror.com/mitt/-/mitt-3.0.1.tgz",
|
||||||
|
"_shasum": "ea36cf0cc30403601ae074c8f77b7092cdab36d1",
|
||||||
|
"_spec": "mitt",
|
||||||
|
"_where": "D:\\FeiYi",
|
||||||
|
"authors": [
|
||||||
|
"Jason Miller <jason@developit.ca>"
|
||||||
|
],
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/developit/mitt/issues"
|
||||||
|
},
|
||||||
|
"bundleDependencies": false,
|
||||||
|
"deprecated": false,
|
||||||
|
"description": "Tiny 200b functional Event Emitter / pubsub.",
|
||||||
|
"devDependencies": {
|
||||||
|
"@types/chai": "^4.2.11",
|
||||||
|
"@types/mocha": "^7.0.2",
|
||||||
|
"@types/sinon": "^9.0.4",
|
||||||
|
"@types/sinon-chai": "^3.2.4",
|
||||||
|
"@typescript-eslint/eslint-plugin": "^5.61.0",
|
||||||
|
"@typescript-eslint/parser": "^5.61.0",
|
||||||
|
"chai": "^4.2.0",
|
||||||
|
"documentation": "^14.0.2",
|
||||||
|
"eslint": "^7.32.0",
|
||||||
|
"eslint-config-developit": "^1.2.0",
|
||||||
|
"eslint-plugin-compat": "^4.1.4",
|
||||||
|
"esm": "^3.2.25",
|
||||||
|
"microbundle": "^0.12.3",
|
||||||
|
"mocha": "^8.0.1",
|
||||||
|
"npm-run-all": "^4.1.5",
|
||||||
|
"prettier": "^2.8.8",
|
||||||
|
"rimraf": "^3.0.2",
|
||||||
|
"sinon": "^9.0.2",
|
||||||
|
"sinon-chai": "^3.5.0",
|
||||||
|
"ts-node": "^10.9.1",
|
||||||
|
"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
Normal file
21
node_modules/pinia/LICENSE
generated
vendored
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
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
Normal file
24
node_modules/pinia/README.md
generated
vendored
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
<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
Normal file
2060
node_modules/pinia/dist/pinia.cjs
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1072
node_modules/pinia/dist/pinia.d.ts
generated
vendored
Normal file
1072
node_modules/pinia/dist/pinia.d.ts
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
2035
node_modules/pinia/dist/pinia.esm-browser.js
generated
vendored
Normal file
2035
node_modules/pinia/dist/pinia.esm-browser.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
2222
node_modules/pinia/dist/pinia.iife.js
generated
vendored
Normal file
2222
node_modules/pinia/dist/pinia.iife.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
7
node_modules/pinia/dist/pinia.iife.prod.js
generated
vendored
Normal file
7
node_modules/pinia/dist/pinia.iife.prod.js
generated
vendored
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
/*!
|
||||||
|
* 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
Normal file
2043
node_modules/pinia/dist/pinia.mjs
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
845
node_modules/pinia/dist/pinia.prod.cjs
generated
vendored
Normal file
845
node_modules/pinia/dist/pinia.prod.cjs
generated
vendored
Normal file
|
@ -0,0 +1,845 @@
|
||||||
|
/*!
|
||||||
|
* 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
Normal file
7
node_modules/pinia/index.cjs
generated
vendored
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
'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
Normal file
7
node_modules/pinia/index.js
generated
vendored
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
'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
Normal file
126
node_modules/pinia/package.json
generated
vendored
Normal file
|
@ -0,0 +1,126 @@
|
||||||
|
{
|
||||||
|
"_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
Normal file
21
node_modules/vue-demi/LICENSE
generated
vendored
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
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
Normal file
229
node_modules/vue-demi/README.md
generated
vendored
Normal file
|
@ -0,0 +1,229 @@
|
||||||
|
<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
Normal file
3
node_modules/vue-demi/bin/vue-demi-fix.js
generated
vendored
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
#!/usr/bin/env node
|
||||||
|
'use strict'
|
||||||
|
require('../scripts/postinstall')
|
3
node_modules/vue-demi/bin/vue-demi-switch.js
generated
vendored
Normal file
3
node_modules/vue-demi/bin/vue-demi-switch.js
generated
vendored
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
#!/usr/bin/env node
|
||||||
|
'use strict'
|
||||||
|
require('../scripts/switch-cli')
|
29
node_modules/vue-demi/lib/index.cjs
generated
vendored
Normal file
29
node_modules/vue-demi/lib/index.cjs
generated
vendored
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
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
Normal file
22
node_modules/vue-demi/lib/index.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
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
Normal file
126
node_modules/vue-demi/lib/index.iife.js
generated
vendored
Normal file
|
@ -0,0 +1,126 @@
|
||||||
|
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
Normal file
34
node_modules/vue-demi/lib/index.mjs
generated
vendored
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
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
Normal file
60
node_modules/vue-demi/lib/v2.7/index.cjs
generated
vendored
Normal file
|
@ -0,0 +1,60 @@
|
||||||
|
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
Normal file
38
node_modules/vue-demi/lib/v2.7/index.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
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
Normal file
80
node_modules/vue-demi/lib/v2.7/index.mjs
generated
vendored
Normal file
|
@ -0,0 +1,80 @@
|
||||||
|
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
Normal file
34
node_modules/vue-demi/lib/v2/index.cjs
generated
vendored
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
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
Normal file
33
node_modules/vue-demi/lib/v2/index.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
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
Normal file
49
node_modules/vue-demi/lib/v2/index.mjs
generated
vendored
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
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
Normal file
29
node_modules/vue-demi/lib/v3/index.cjs
generated
vendored
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
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
Normal file
22
node_modules/vue-demi/lib/v3/index.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
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
Normal file
34
node_modules/vue-demi/lib/v3/index.mjs
generated
vendored
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
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
Normal file
83
node_modules/vue-demi/package.json
generated
vendored
Normal file
|
@ -0,0 +1,83 @@
|
||||||
|
{
|
||||||
|
"_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
Normal file
19
node_modules/vue-demi/scripts/postinstall.js
generated
vendored
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
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
Normal file
18
node_modules/vue-demi/scripts/switch-cli.js
generated
vendored
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
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
Normal file
62
node_modules/vue-demi/scripts/utils.js
generated
vendored
Normal file
|
@ -0,0 +1,62 @@
|
||||||
|
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
|
30
package-lock.json
generated
Normal file
30
package-lock.json
generated
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
{
|
||||||
|
"requires": true,
|
||||||
|
"lockfileVersion": 1,
|
||||||
|
"dependencies": {
|
||||||
|
"@vue/devtools-api": {
|
||||||
|
"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": {
|
||||||
|
"version": "0.14.10",
|
||||||
|
"resolved": "https://registry.npmmirror.com/vue-demi/-/vue-demi-0.14.10.tgz",
|
||||||
|
"integrity": "sha512-nMZBOwuzabUO0nLgIcc6rycZEebF6eeUfaiQx9+WSk8e29IbLvPU9feI6tqW4kTo3hvoYAJkMh8n8D0fuISphg=="
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -157,6 +157,13 @@
|
||||||
{
|
{
|
||||||
"navigationBarTitleText" : ""
|
"navigationBarTitleText" : ""
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path" : "pages/order/productOrderDetail/productOrderDetail",
|
||||||
|
"style" :
|
||||||
|
{
|
||||||
|
"navigationBarTitleText" : ""
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"globalStyle": {
|
"globalStyle": {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="flex-col page">
|
<view class="flex-col page">
|
||||||
<view class="flex-row section">
|
<view class="flex-row section" >
|
||||||
<image
|
<image
|
||||||
class="self-center image"
|
class="self-center image"
|
||||||
:src="avator"
|
:src="avator"
|
||||||
|
@ -102,6 +102,7 @@
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import {ref} from 'vue'
|
import {ref} from 'vue'
|
||||||
|
import { userStore } from '../../../store/userStore'
|
||||||
import address from '@/pages/mine/main/img/address.png'
|
import address from '@/pages/mine/main/img/address.png'
|
||||||
import avator from '@/pages/mine/main/img/avator.png'
|
import avator from '@/pages/mine/main/img/avator.png'
|
||||||
import background from '@/pages/mine/main/img/background.png'
|
import background from '@/pages/mine/main/img/background.png'
|
||||||
|
@ -113,7 +114,67 @@ import qianbao from '@/pages/mine/main/img/qianbao.png'
|
||||||
import setting_s from '@/pages/mine/main/img/setting_s.png'
|
import setting_s from '@/pages/mine/main/img/setting_s.png'
|
||||||
import tuikuan from '@/pages/mine/main/img/tuikuan.png'
|
import tuikuan from '@/pages/mine/main/img/tuikuan.png'
|
||||||
import you from '@/pages/mine/main/img/you.png'
|
import you from '@/pages/mine/main/img/you.png'
|
||||||
|
|
||||||
|
|
||||||
|
const store = userStore()
|
||||||
|
const login = () => {
|
||||||
|
uni.getUserProfile({
|
||||||
|
lang: 'zh_CN',
|
||||||
|
desc: '用户登录', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,
|
||||||
|
success: (res) => {
|
||||||
|
console.log(res, 'resss')
|
||||||
|
resolve(res.userInfo)
|
||||||
|
},
|
||||||
|
fail: (err) => {
|
||||||
|
reject(err)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
// uni.login({
|
||||||
|
// provider: 'weixin',
|
||||||
|
// success: (loginRes) => {
|
||||||
|
// if(loginRes.code !== null) {
|
||||||
|
// console.log("获取code:" + loginRes.code)
|
||||||
|
// loginUser(loginRes.code);
|
||||||
|
// } else {
|
||||||
|
// console.log("code为空");
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
}
|
||||||
|
const loginUser=(code)=>{
|
||||||
|
uni.request({
|
||||||
|
url:apiImageUrl+'user/login/wx_open',
|
||||||
|
method:'GET',
|
||||||
|
data:{
|
||||||
|
code:code
|
||||||
|
},
|
||||||
|
success: (res) => {
|
||||||
|
console.log(res,"是否有code")
|
||||||
|
uni.removeStorageSync('cookie');// 保fCookie到Storage
|
||||||
|
uni.setStorageSync("cookie", res.header['Set-Cookie']);
|
||||||
|
if(res.data.code==1){
|
||||||
|
uni.showToast({
|
||||||
|
title:'登录成功',
|
||||||
|
duration:2000
|
||||||
|
})
|
||||||
|
|
||||||
|
//每次登录时清楚缓存
|
||||||
|
uni.setStorageSync('userInfo',res.data.data)
|
||||||
|
uni.switchTab({
|
||||||
|
url:'/pages/index/index'
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
uni.showToast({
|
||||||
|
icon: 'error',
|
||||||
|
title: "登录失败,请联系管理员"
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
184
pages/order/component/addressComponent.vue
Normal file
184
pages/order/component/addressComponent.vue
Normal file
|
@ -0,0 +1,184 @@
|
||||||
|
<template>
|
||||||
|
<view class="flex-col page">
|
||||||
|
<view class="flex-row justify-center items-center relative group">
|
||||||
|
<text class="text">收货地址</text>
|
||||||
|
<image class="image pos" @click="close"
|
||||||
|
src="https://ide.code.fun/api/image?token=6726d42bc471750012ddd6db&name=4bb5072c88795ed4234ff0c7f7a35a23.png" />
|
||||||
|
</view>
|
||||||
|
<view class="flex-col list">
|
||||||
|
<radio-group @change="radioChange">
|
||||||
|
<view class="flex-col list-item_1" v-for="(item, index) in addressList" :key="index">
|
||||||
|
<view class="flex-row justify-between items-center self-stretch">
|
||||||
|
<view class="flex-row items-center">
|
||||||
|
<!-- <image
|
||||||
|
class="shrink-0 image_2"
|
||||||
|
src="https://ide.code.fun/api/image?token=6726d42bc471750012ddd6db&name=77acc0c7f94beb4408728eee129ffe97.png"
|
||||||
|
/> -->
|
||||||
|
<radio color="#00ba9c" :value="index" :checked="index === current"></radio>
|
||||||
|
<text class="font ml-9">{{ item.name }}</text>
|
||||||
|
<text class="font_2 ml-9">{{ item.phone }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="flex-row group_3">
|
||||||
|
<image class="image_3"
|
||||||
|
src="https://ide.code.fun/api/image?token=6726d42bc471750012ddd6db&name=dea6c36cff62ddc7551d1917f90fb560.png" />
|
||||||
|
<image class="image_3 ml-12"
|
||||||
|
src="https://ide.code.fun/api/image?token=6726d42bc471750012ddd6db&name=ce0e844eea3b34834f6a6293bc01a3ed.png" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<text class="self-center font_3 text_2 mt-12">{{ item.detailAddress }}</text>
|
||||||
|
</view>
|
||||||
|
</radio-group>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="flex-col justify-start items-center section">
|
||||||
|
<view class="flex-col justify-start items-center text-wrapper"><text class="text_3">添加新地址</text></view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { onMounted , ref } from 'vue'
|
||||||
|
import emitter from '../../utils/emitter';
|
||||||
|
import { testUrl } from '../../../api/request';
|
||||||
|
import { userStore } from '../../../store/userStore';
|
||||||
|
const items = ref([null, null])
|
||||||
|
const addressList = ref([])
|
||||||
|
const store = userStore() //获取登录用户的信息
|
||||||
|
onMounted(() => {
|
||||||
|
getAddressList()
|
||||||
|
})
|
||||||
|
//根据登录用户获取地址列表
|
||||||
|
const getAddressList = async () =>{
|
||||||
|
const res = await uni.request({
|
||||||
|
url: testUrl + '/address/list' ,
|
||||||
|
method: 'POST',
|
||||||
|
data: {
|
||||||
|
id : store.userInfo.id
|
||||||
|
}
|
||||||
|
})
|
||||||
|
addressList.value = res.data.data
|
||||||
|
// console.log(addressList.value);
|
||||||
|
}
|
||||||
|
const close = () => {
|
||||||
|
emitter.emit('close')
|
||||||
|
}
|
||||||
|
//当选项发生改变时
|
||||||
|
const radioChange = ( event ) => {
|
||||||
|
const index = event.detail.value
|
||||||
|
const temp = addressList.value[index] //通过emitter传入暂时的地址信息
|
||||||
|
// console.log('temp',temp);
|
||||||
|
emitter.emit('addressInfo', temp )
|
||||||
|
emitter.emit('close')
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.ml-9 {
|
||||||
|
margin-left: 16.88rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.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.47rpx 24.38rpx 6.26rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text {
|
||||||
|
color: #323232;
|
||||||
|
font-size: 37.5rpx;
|
||||||
|
font-family: Open Sans;
|
||||||
|
line-height: 34.76rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image {
|
||||||
|
width: 52.5rpx;
|
||||||
|
height: 52.5rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pos {
|
||||||
|
position: absolute;
|
||||||
|
right: 24.38rpx;
|
||||||
|
top: 50%;
|
||||||
|
transform: translateY(-50%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.list {
|
||||||
|
margin-top: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.list-item_1 {
|
||||||
|
padding: 26.27rpx 16.8rpx 24.98rpx;
|
||||||
|
background-color: #fffef8;
|
||||||
|
border-bottom: solid 1.88rpx #c8c8c8;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image_2 {
|
||||||
|
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_3 {
|
||||||
|
margin-right: 10.97rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image_3 {
|
||||||
|
width: 39.38rpx;
|
||||||
|
height: 39.38rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.font_3 {
|
||||||
|
font-size: 26.25rpx;
|
||||||
|
font-family: Open Sans;
|
||||||
|
line-height: 31.88rpx;
|
||||||
|
color: #818181;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text_2 {
|
||||||
|
width: 601.88rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.section {
|
||||||
|
margin-top: 202.5rpx;
|
||||||
|
padding: 18.75rpx 0;
|
||||||
|
background-color: #fffef8;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-wrapper {
|
||||||
|
padding: 27.9rpx 0 29.01rpx;
|
||||||
|
background-color: #fbb612;
|
||||||
|
border-radius: 75rpx;
|
||||||
|
width: 639.38rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text_3 {
|
||||||
|
color: #ffffff;
|
||||||
|
font-size: 33.75rpx;
|
||||||
|
font-family: Open Sans;
|
||||||
|
line-height: 31.22rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
@import url(../../../common/css/global.css);
|
||||||
|
</style>
|
|
@ -1,192 +1,207 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="flex-col page">
|
<view class="flex-col page">
|
||||||
<view class="flex-row justify-center items-center">
|
<view class="flex-row justify-center items-center">
|
||||||
<image
|
<image class="image" :src="success" />
|
||||||
class="image"
|
<text class="text ml-11">支付成功</text>
|
||||||
:src="success" />
|
</view>
|
||||||
<text class="text ml-11">支付成功</text>
|
<view class="flex-row justify-between group mt-47">
|
||||||
</view>
|
<view class="flex-col justify-start items-center text-wrapper"><text class="font text_2">返回首页</text></view>
|
||||||
<view class="flex-row justify-between group mt-47">
|
<view class="flex-col justify-start items-center text-wrapper_2" @click="toOrderDetail"><text
|
||||||
<view class="flex-col justify-start items-center text-wrapper"><text class="font text_2">返回首页</text></view>
|
class="font text_3">查看订单</text></view>
|
||||||
<view class="flex-col justify-start items-center text-wrapper_2"><text class="font text_3">查看订单</text></view>
|
</view>
|
||||||
</view>
|
<view class="flex-col mt-47">
|
||||||
<view class="flex-col mt-47">
|
<view class="flex-row justify-center items-center">
|
||||||
<view class="flex-row justify-center items-center">
|
<image class="image_2" :src="xian" />
|
||||||
<image
|
<text class="text_4 ml-11">更多精选商品</text>
|
||||||
class="image_2"
|
<image class="image_2 ml-11" :src="xian2" />
|
||||||
:src="xian" />
|
</view>
|
||||||
<text class="text_4 ml-11">更多精选商品</text>
|
<view class="grid mt-19">
|
||||||
<image
|
<view class="flex-col grid-item" v-for="(item, index) in products" :key="index">
|
||||||
class="image_2 ml-11"
|
<image class="shrink-0 image_3" :src="item.product_img" />
|
||||||
:src="xian2" />
|
<text class="font_2 text_5">【{{ item.product_type }}】{{ item.product_name }}</text>
|
||||||
</view>
|
<view class="flex-row items-center group_2">
|
||||||
<view class="grid mt-19">
|
<image class="image_4" :src="rmb" />
|
||||||
<view class="flex-col grid-item" v-for="(item, index) in products" :key="index">
|
<text class="font_3">{{ item.product_value }}.00</text>
|
||||||
<image
|
</view>
|
||||||
class="shrink-0 image_3"
|
</view>
|
||||||
:src="item.product_img"
|
</view>
|
||||||
/>
|
</view>
|
||||||
<text class="font_2 text_5">【{{ item.product_type }}】{{ item.product_name }}</text>
|
|
||||||
<view class="flex-row items-center group_2">
|
|
||||||
<image
|
|
||||||
class="image_4"
|
|
||||||
:src="rmb" />
|
|
||||||
<text class="font_3">{{ item.product_value }}.00</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import {ref} from 'vue'
|
import { ref } from 'vue'
|
||||||
import success from '@/pages/order/paysuccess/img/success.png'
|
import success from '@/pages/order/paysuccess/img/success.png'
|
||||||
import xian from '@/pages/order/paysuccess/img/xian.png'
|
import xian from '@/pages/order/paysuccess/img/xian.png'
|
||||||
import xian2 from '@/pages/order/paysuccess/img/xian2.png'
|
import xian2 from '@/pages/order/paysuccess/img/xian2.png'
|
||||||
import rmb from '@/pages/order/paysuccess/img/rmb.png'
|
import rmb from '@/pages/order/paysuccess/img/rmb.png'
|
||||||
import product from '@/pages/order/paysuccess/img/product.png'
|
import product from '@/pages/order/paysuccess/img/product.png'
|
||||||
const products = ref([
|
const products = ref([{
|
||||||
{
|
product_img: product,
|
||||||
product_img : product,
|
product_type: "非遗手工艺体验",
|
||||||
product_type : "非遗手工艺体验",
|
product_name: "玉雕-古法制玉体验",
|
||||||
product_name : "玉雕-古法制玉体验",
|
|
||||||
product_value: 99
|
product_value: 99
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
product_img : product,
|
product_img: product,
|
||||||
product_type : "非遗手工艺体验",
|
product_type: "非遗手工艺体验",
|
||||||
product_name : "玉雕-古法制玉体验",
|
product_name: "玉雕-古法制玉体验",
|
||||||
product_value: 99
|
product_value: 99
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
product_img : product,
|
product_img: product,
|
||||||
product_type : "非遗手工艺体验",
|
product_type: "非遗手工艺体验",
|
||||||
product_name : "玉雕-古法制玉体验",
|
product_name: "玉雕-古法制玉体验",
|
||||||
product_value: 99
|
product_value: 99
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
product_img : product,
|
product_img: product,
|
||||||
product_type : "非遗手工艺体验",
|
product_type: "非遗手工艺体验",
|
||||||
product_name : "玉雕-古法制玉体验",
|
product_name: "玉雕-古法制玉体验",
|
||||||
product_value: 99
|
product_value: 99
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
const toOrderDetail = () => {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '../productOrderDetail/productOrderDetail'
|
||||||
|
})
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.mt-47 {
|
.mt-47 {
|
||||||
margin-top: 88.13rpx;
|
margin-top: 88.13rpx;
|
||||||
}
|
}
|
||||||
.ml-11 {
|
|
||||||
margin-left: 20.63rpx;
|
.ml-11 {
|
||||||
}
|
margin-left: 20.63rpx;
|
||||||
.mt-19 {
|
}
|
||||||
margin-top: 35.63rpx;
|
|
||||||
}
|
.mt-19 {
|
||||||
.page {
|
margin-top: 35.63rpx;
|
||||||
padding: 183.75rpx 13.59rpx 41.25rpx 16.41rpx;
|
}
|
||||||
background-color: #fffaf0;
|
|
||||||
width: 100%;
|
.page {
|
||||||
overflow-y: auto;
|
padding: 183.75rpx 13.59rpx 41.25rpx 16.41rpx;
|
||||||
overflow-x: hidden;
|
background-color: #fffaf0;
|
||||||
height: 100%;
|
width: 100%;
|
||||||
}
|
overflow-y: auto;
|
||||||
.image {
|
overflow-x: hidden;
|
||||||
width: 56.25rpx;
|
height: 100%;
|
||||||
height: 52.5rpx;
|
}
|
||||||
}
|
|
||||||
.text {
|
.image {
|
||||||
color: #000000;
|
width: 56.25rpx;
|
||||||
font-size: 45rpx;
|
height: 52.5rpx;
|
||||||
font-family: Inter;
|
}
|
||||||
line-height: 41.66rpx;
|
|
||||||
}
|
.text {
|
||||||
.group {
|
color: #000000;
|
||||||
padding: 0 66.09rpx;
|
font-size: 45rpx;
|
||||||
}
|
font-family: Inter;
|
||||||
.text-wrapper {
|
line-height: 41.66rpx;
|
||||||
padding: 23.34rpx 0 23.87rpx;
|
}
|
||||||
background-color: #fffef8;
|
|
||||||
border-radius: 75rpx;
|
.group {
|
||||||
width: 221.25rpx;
|
padding: 0 66.09rpx;
|
||||||
height: 78.75rpx;
|
}
|
||||||
border: solid 1.88rpx #818181;
|
|
||||||
}
|
.text-wrapper {
|
||||||
.font {
|
padding: 23.34rpx 0 23.87rpx;
|
||||||
font-size: 30rpx;
|
background-color: #fffef8;
|
||||||
font-family: Inter;
|
border-radius: 75rpx;
|
||||||
line-height: 27.71rpx;
|
width: 221.25rpx;
|
||||||
color: #fbb612;
|
height: 78.75rpx;
|
||||||
}
|
border: solid 1.88rpx #818181;
|
||||||
.text_2 {
|
}
|
||||||
line-height: 27.79rpx;
|
|
||||||
}
|
.font {
|
||||||
.text-wrapper_2 {
|
font-size: 30rpx;
|
||||||
padding: 23.42rpx 0 23.89rpx;
|
font-family: Inter;
|
||||||
background-color: #fffef8;
|
line-height: 27.71rpx;
|
||||||
border-radius: 75rpx;
|
color: #fbb612;
|
||||||
width: 221.25rpx;
|
}
|
||||||
height: 78.75rpx;
|
|
||||||
border: solid 1.88rpx #818181;
|
.text_2 {
|
||||||
}
|
line-height: 27.79rpx;
|
||||||
.text_3 {
|
}
|
||||||
line-height: 27.69rpx;
|
|
||||||
}
|
.text-wrapper_2 {
|
||||||
.image_2 {
|
padding: 23.42rpx 0 23.89rpx;
|
||||||
width: 251.25rpx;
|
background-color: #fffef8;
|
||||||
height: 1.88rpx;
|
border-radius: 75rpx;
|
||||||
}
|
width: 221.25rpx;
|
||||||
.text_4 {
|
height: 78.75rpx;
|
||||||
color: #323232;
|
border: solid 1.88rpx #818181;
|
||||||
font-size: 30rpx;
|
}
|
||||||
font-family: Open Sans;
|
|
||||||
line-height: 27.71rpx;
|
.text_3 {
|
||||||
}
|
line-height: 27.69rpx;
|
||||||
.grid {
|
}
|
||||||
margin-left: 11.72rpx;
|
|
||||||
margin-right: 14.53rpx;
|
.image_2 {
|
||||||
height: 965.63rpx;
|
width: 251.25rpx;
|
||||||
display: grid;
|
height: 1.88rpx;
|
||||||
grid-template-rows: repeat(2, minmax(0, 1fr));
|
}
|
||||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
||||||
row-gap: 30.13rpx;
|
.text_4 {
|
||||||
column-gap: 28.26rpx;
|
color: #323232;
|
||||||
}
|
font-size: 30rpx;
|
||||||
.grid-item {
|
font-family: Open Sans;
|
||||||
padding-bottom: 28.26rpx;
|
line-height: 27.71rpx;
|
||||||
background-color: #ffffff;
|
}
|
||||||
border-radius: 18.75rpx;
|
|
||||||
border: solid 1.88rpx #818181;
|
.grid {
|
||||||
}
|
margin-left: 11.72rpx;
|
||||||
.image_3 {
|
margin-right: 14.53rpx;
|
||||||
border-radius: 18.75rpx 18.75rpx 0rpx 0rpx;
|
height: 965.63rpx;
|
||||||
width: 333.75rpx;
|
display: grid;
|
||||||
height: 322.5rpx;
|
grid-template-rows: repeat(2, minmax(0, 1fr));
|
||||||
}
|
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||||
.font_2 {
|
row-gap: 30.13rpx;
|
||||||
font-size: 24.38rpx;
|
column-gap: 28.26rpx;
|
||||||
font-family: Open Sans;
|
}
|
||||||
line-height: 30rpx;
|
|
||||||
color: #000000;
|
.grid-item {
|
||||||
}
|
padding-bottom: 28.26rpx;
|
||||||
.text_5 {
|
background-color: #ffffff;
|
||||||
margin: 8.42rpx 6.69rpx 0 12.06rpx;
|
border-radius: 18.75rpx;
|
||||||
}
|
border: solid 1.88rpx #818181;
|
||||||
.group_2 {
|
}
|
||||||
margin-top: 17.83rpx;
|
|
||||||
padding: 0 22.37rpx;
|
.image_3 {
|
||||||
}
|
border-radius: 18.75rpx 18.75rpx 0rpx 0rpx;
|
||||||
.image_4 {
|
width: 333.75rpx;
|
||||||
width: 26.25rpx;
|
height: 322.5rpx;
|
||||||
height: 26.25rpx;
|
}
|
||||||
}
|
|
||||||
.font_3 {
|
.font_2 {
|
||||||
font-size: 30rpx;
|
font-size: 24.38rpx;
|
||||||
font-family: Times New Roman;
|
font-family: Open Sans;
|
||||||
line-height: 20.68rpx;
|
line-height: 30rpx;
|
||||||
color: #fbb612;
|
color: #000000;
|
||||||
}
|
}
|
||||||
@import url(../../../common/css/global.css);
|
|
||||||
</style>
|
.text_5 {
|
||||||
|
margin: 8.42rpx 6.69rpx 0 12.06rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.group_2 {
|
||||||
|
margin-top: 17.83rpx;
|
||||||
|
padding: 0 22.37rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image_4 {
|
||||||
|
width: 26.25rpx;
|
||||||
|
height: 26.25rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.font_3 {
|
||||||
|
font-size: 30rpx;
|
||||||
|
font-family: Times New Roman;
|
||||||
|
line-height: 20.68rpx;
|
||||||
|
color: #fbb612;
|
||||||
|
}
|
||||||
|
|
||||||
|
@import url(../../../common/css/global.css);
|
||||||
|
</style>
|
|
@ -1,3 +1,4 @@
|
||||||
|
<!-- 单个商品购买页面 -->
|
||||||
<template>
|
<template>
|
||||||
<view class="flex-col page">
|
<view class="flex-col page">
|
||||||
<view class="flex-col justify-start">
|
<view class="flex-col justify-start">
|
||||||
|
@ -5,16 +6,16 @@
|
||||||
<view class="flex-col section">
|
<view class="flex-col section">
|
||||||
<view class="flex-row justify-between">
|
<view class="flex-row justify-between">
|
||||||
<view class="flex-col">
|
<view class="flex-col">
|
||||||
<text class="self-center font text">{{ address.address }}</text>
|
<text class="self-center font text">{{ addressRealInfo.region }}</text>
|
||||||
<view class="flex-row items-center self-stretch">
|
<view class="flex-row items-center self-stretch">
|
||||||
<image
|
<image
|
||||||
class="shrink-0 image_2"
|
class="shrink-0 image_2"
|
||||||
:src="dingwei"
|
:src="dingwei"
|
||||||
/>
|
/>
|
||||||
<text class="font_2 text_2 ml-7">{{ address.detail }}</text>
|
<text class="font_2 text_2 ml-7">{{ addressRealInfo.detailAddress }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex-row self-start group_2">
|
<view class="flex-row self-start group_2" @click="loadPop()">
|
||||||
<image
|
<image
|
||||||
class="image_3"
|
class="image_3"
|
||||||
:src="you_cheng"
|
:src="you_cheng"
|
||||||
|
@ -23,53 +24,47 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex-row items-baseline group_3 mt-4">
|
<view class="flex-row items-baseline group_3 mt-4">
|
||||||
<text class="font_2 text_4">{{ address.name }}</text>
|
<text class="font_2 text_4">{{ addressRealInfo.name }}</text>
|
||||||
<text class="font_2 text_5">{{ address.phone }}</text>
|
<text class="font_2 text_5">{{ addressRealInfo.phone }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex-col section_2 mt-8" v-for="(item , index) in product_object" :key="index">
|
<view class="flex-col section_2 mt-8">
|
||||||
<view class="flex-row">
|
<view class="flex-row">
|
||||||
<image
|
<image
|
||||||
class="image_4"
|
class="image_4"
|
||||||
:src="item.product_img" />
|
:src="productObject.goodImg" />
|
||||||
<view class="flex-col self-start group_4 ml-17">
|
<view class="flex-col self-start group_4 ml-17">
|
||||||
<view class="flex-row self-stretch">
|
<view class="flex-row self-stretch">
|
||||||
<text class="font">{{ item.product_name }}</text>
|
<text class="font">{{ productObject.name }}</text>
|
||||||
<text class="font ml-4">【{{ item.product_type }}】</text>
|
<text class="font ml-4">【{{ productObject.type }}】</text>
|
||||||
</view>
|
</view>
|
||||||
<text class="self-start font_2 text_6 mt-12">已选种类:{{ item.selected_style }}</text>
|
<!-- <text class="self-start font_2 text_6 mt-12">已选种类:{{ item.selected_style }}</text> -->
|
||||||
<view class="flex-row self-stretch mt-12" >
|
<view class="flex-row self-stretch mt-12" >
|
||||||
<view class="flex-col justify-start items-center text-wrapper">
|
<view class="flex-col justify-start items-center text-wrapper" v-for="(item , index) in labelList" :key="index">
|
||||||
<text class="font_2 text_7">#{{ item.tag[0] }}</text>
|
<text class="font_2 text_7">#{{ labelList[index] }}</text>
|
||||||
</view>
|
|
||||||
<view class="flex-col justify-start items-center text-wrapper_2 ml-6">
|
|
||||||
<text class="font_2 text_8">#{{ item.tag[1] }}</text>
|
|
||||||
</view>
|
|
||||||
<view class="flex-col justify-start items-center text-wrapper_3 ml-6">
|
|
||||||
<text class="font_2 text_9">#{{ item.tag[2] }}</text>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex-row justify-between items-center group_5">
|
<view class="flex-row justify-between items-center group_5">
|
||||||
<view class="flex-row items-center group_6">
|
<view class="flex-row items-center group_6">
|
||||||
<text class="text_10">{{ item.product_price }}</text>
|
<text class="text_10">{{ productObject.price }}</text>
|
||||||
<image
|
<image
|
||||||
class="shrink-0 image_7 image_8"
|
class="shrink-0 image_7 image_8"
|
||||||
:src="item.rmb_img"
|
:src="rmb_32"
|
||||||
/>
|
/>
|
||||||
<text class="font text_11">.00</text>
|
<text class="font text_11">.00</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex-row">
|
<view class="flex-row">
|
||||||
<image
|
<image
|
||||||
class="image_5"
|
class="image_5"
|
||||||
:src="item.min_img" />
|
:src="short" />
|
||||||
<view class="flex-col justify-start items-center text-wrapper_4 ml-2">
|
<view class="flex-col justify-start items-center text-wrapper_4 ml-2">
|
||||||
<text class="font text_12">1</text>
|
<text class="font text_12">1</text>
|
||||||
</view>
|
</view>
|
||||||
<image
|
<image
|
||||||
class="image_6 ml-2"
|
class="image_6 ml-2"
|
||||||
:src="item.add_img"
|
:src="add"
|
||||||
/>
|
/>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -88,14 +83,14 @@
|
||||||
<view class="flex-row justify-between items-center group_9">
|
<view class="flex-row justify-between items-center group_9">
|
||||||
<view class="flex-row">
|
<view class="flex-row">
|
||||||
<text class="font_4 text_15">商品总价</text>
|
<text class="font_4 text_15">商品总价</text>
|
||||||
<text class="font_5 text_16 ml-7">共{{ num }}件商品</text>
|
<text class="font_5 text_16 ml-7">共 {{ num }} 件商品</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex-row items-center">
|
<view class="flex-row items-center">
|
||||||
<image
|
<image
|
||||||
class="shrink-0 image_10"
|
class="shrink-0 image_10"
|
||||||
:src="rmb_36px"
|
:src="rmb_36px"
|
||||||
/>
|
/>
|
||||||
<text class="font_6">138.00</text>
|
<text class="font_6">{{ productObject.price }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex-col mt-25">
|
<view class="flex-col mt-25">
|
||||||
|
@ -128,7 +123,7 @@
|
||||||
class="shrink-0 image_10"
|
class="shrink-0 image_10"
|
||||||
:src="rmb_36px"
|
:src="rmb_36px"
|
||||||
/>
|
/>
|
||||||
<text class="font_6">{{ sumprice }}.00</text>
|
<text class="font_6">{{ productObject.price - 50 }}.00</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -153,61 +148,96 @@
|
||||||
<view class="flex-col justify-start items-center text-wrapper_6" @click="jump_pay"><text class="font_4 text_26">微信支付</text></view>
|
<view class="flex-col justify-start items-center text-wrapper_6" @click="jump_pay"><text class="font_4 text_26">微信支付</text></view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<uni-popup ref="popup" background-color="#fff" @change="change">
|
||||||
|
<view class="popup-content">
|
||||||
|
<addressComponentVue></addressComponentVue>
|
||||||
|
</view>
|
||||||
|
</uni-popup>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import {ref} from 'vue'
|
import {onMounted, ref} from 'vue'
|
||||||
import add from '@/pages/order/product-waitpay/img/add.png';
|
import emitter from '../../utils/emitter';
|
||||||
import dingwei from '@/pages/order/product-waitpay/img/dingwei.png';
|
import { onLoad } from "@dcloudio/uni-app";
|
||||||
import product from '@/pages/order/product-waitpay/img/product.png';
|
//图片暂时存在本地
|
||||||
import rmb_32 from '@/pages/order/product-waitpay/img/rmb_32.png';
|
import addressComponentVue from '../component/addressComponent.vue'; //带入组件
|
||||||
import rmb_36px from '@/pages/order/product-waitpay/img/rmb_36px.png';
|
import add from '@/pages/order/product-waitpay/img/add.png';
|
||||||
import rmb_cheng from '@/pages/order/product-waitpay/img/rmb_cheng.png';
|
import dingwei from '@/pages/order/product-waitpay/img/dingwei.png';
|
||||||
import rmb_huang from '@/pages/order/product-waitpay/img/rmb_huang.png';
|
import product from '@/pages/order/product-waitpay/img/product.png';
|
||||||
import short from '@/pages/order/product-waitpay/img/short.png';
|
import rmb_32 from '@/pages/order/product-waitpay/img/rmb_32.png';
|
||||||
import yiwen from '@/pages/order/product-waitpay/img/yiwen.png';
|
import rmb_36px from '@/pages/order/product-waitpay/img/rmb_36px.png';
|
||||||
import you_cheng from '@/pages/order/product-waitpay/img/you_cheng.png';
|
import rmb_cheng from '@/pages/order/product-waitpay/img/rmb_cheng.png';
|
||||||
import you_hei from '@/pages/order/product-waitpay/img/you_hei.png';
|
import rmb_huang from '@/pages/order/product-waitpay/img/rmb_huang.png';
|
||||||
|
import short from '@/pages/order/product-waitpay/img/short.png';
|
||||||
const jump_pay =()=> {
|
import yiwen from '@/pages/order/product-waitpay/img/yiwen.png';
|
||||||
console.log(123)
|
import you_cheng from '@/pages/order/product-waitpay/img/you_cheng.png';
|
||||||
uni.navigateTo({
|
import you_hei from '@/pages/order/product-waitpay/img/you_hei.png';
|
||||||
url: '../../../pages/order/paysuccess/paysuccess'
|
|
||||||
})
|
const popup = ref(null) //弹窗对象
|
||||||
|
const addressRealInfo = ref({}) //地址页 选择地址传过来的值
|
||||||
|
const productObject = ref({})
|
||||||
|
const labelList = ref([]) //老套路,商品标签
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
emitter.on('close', () => {
|
||||||
|
close()
|
||||||
|
})
|
||||||
|
emitter.on('addressInfo', (val) =>{
|
||||||
|
addressRealInfo.value = val
|
||||||
|
// console.log('addressInfo',val);
|
||||||
|
})
|
||||||
|
})
|
||||||
|
onLoad((options)=>{
|
||||||
|
productObject.value = JSON.parse(options.product)
|
||||||
|
labelList.value = productObject.value.label.split(";") //切割商品标签的老套路
|
||||||
|
labelList.value = labelList.value.filter((s)=>{ //使用filter将最后一个空值去掉
|
||||||
|
return s
|
||||||
|
})
|
||||||
|
// console.log(productObject.value.label);
|
||||||
|
})
|
||||||
|
const close = () => {
|
||||||
|
popup.value.close()
|
||||||
|
}
|
||||||
|
const loadPop =() =>{
|
||||||
|
popup.value.open('bottom')
|
||||||
|
}
|
||||||
|
const jump_pay =()=> {
|
||||||
|
console.log(123)
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '../../../pages/order/paysuccess/paysuccess'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
const product_object = ref([
|
||||||
|
{
|
||||||
|
product_name : "非遗绒花",
|
||||||
|
product_type : "材料包",
|
||||||
|
selected_style : "紫色",
|
||||||
|
product_num : 1,
|
||||||
|
product_price : 138,
|
||||||
|
product_img : product,
|
||||||
|
rmb_img : rmb_32,
|
||||||
|
min_img : short,
|
||||||
|
add_img : add,
|
||||||
|
tag : ["绒花","体验包","送亲友"]
|
||||||
}
|
}
|
||||||
|
])
|
||||||
const address = ref(
|
|
||||||
{
|
const num = ref(1)
|
||||||
address : "黑龙江省哈尔滨市呼兰区",
|
const price = ref(138)
|
||||||
detail : "学院路街道288号哈尔滨华德学院",
|
const youhuijuan_num = ref(1)
|
||||||
name : '张三',
|
const manjian = ref(120)
|
||||||
phone : '15888610253'
|
const manjian1 = ref(50)
|
||||||
}
|
const sumprice = ref(88)
|
||||||
)
|
|
||||||
const product_object = ref([
|
|
||||||
{
|
|
||||||
product_name : "非遗绒花",
|
|
||||||
product_type : "材料包",
|
|
||||||
selected_style : "紫色",
|
|
||||||
product_num : 1,
|
|
||||||
product_price : 138,
|
|
||||||
product_img : product,
|
|
||||||
rmb_img : rmb_32,
|
|
||||||
min_img : short,
|
|
||||||
add_img : add,
|
|
||||||
tag : ["绒花","体验包","送亲友"]
|
|
||||||
}
|
|
||||||
])
|
|
||||||
|
|
||||||
const num = ref(1)
|
|
||||||
const price = ref(138)
|
|
||||||
const youhuijuan_num = ref(1)
|
|
||||||
const manjian = ref(120)
|
|
||||||
const manjian1 = ref(50)
|
|
||||||
const sumprice = ref(88)
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
||||||
|
.popup-content {
|
||||||
|
height: 392px;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
background-color: #fff;
|
||||||
|
}
|
||||||
.ml-17 {
|
.ml-17 {
|
||||||
margin-left: 31.88rpx;
|
margin-left: 31.88rpx;
|
||||||
}
|
}
|
||||||
|
|
489
pages/order/productOrderDetail/productOrderDetail.vue
Normal file
489
pages/order/productOrderDetail/productOrderDetail.vue
Normal file
|
@ -0,0 +1,489 @@
|
||||||
|
<template>
|
||||||
|
<view class="flex-col page">
|
||||||
|
<view class="flex-col">
|
||||||
|
<view class="flex-col group">
|
||||||
|
<view class="flex-col group_2">
|
||||||
|
<view class="flex-row items-center section">
|
||||||
|
<image
|
||||||
|
class="image_2"
|
||||||
|
src="https://ide.code.fun/api/image?token=6726d42bc471750012ddd6db&name=9d0406dd677ac37f400278ee3cd0c3b2.png"
|
||||||
|
/>
|
||||||
|
<text class="font text ml-7">等待商家发货</text>
|
||||||
|
</view>
|
||||||
|
<view class="flex-row items-center section_2 mt-9">
|
||||||
|
<image
|
||||||
|
class="shrink-0 image_3"
|
||||||
|
src="https://ide.code.fun/api/image?token=6726d42bc471750012ddd6db&name=5da41d16a3c58ce9514d9a7f9ee5a577.png"
|
||||||
|
/>
|
||||||
|
<view class="flex-col items-start flex-1 ml-8">
|
||||||
|
<text class="font text_2">张三 15888610253</text>
|
||||||
|
<text class="font_2 text_3 mt-12">黑龙江省哈尔滨市呼兰区学院路街道288号哈尔滨华德学院</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="flex-col section_3 mt-9">
|
||||||
|
<view class="flex-row justify-between items-end self-stretch group_3">
|
||||||
|
<view class="flex-row">
|
||||||
|
<image
|
||||||
|
class="image_4"
|
||||||
|
src="https://ide.code.fun/api/image?token=6726d42bc471750012ddd6db&name=1ab7a54755e0a23722c1b9dd0ae981c4.png"
|
||||||
|
/>
|
||||||
|
<view class="flex-col group_4 ml-17">
|
||||||
|
<view class="flex-col">
|
||||||
|
<view class="flex-row self-stretch">
|
||||||
|
<text class="font">非遗绒花</text>
|
||||||
|
<text class="font ml-4">【材料包】</text>
|
||||||
|
</view>
|
||||||
|
<text class="self-start font_2 text_4 mt-11">已选种类:紫色</text>
|
||||||
|
</view>
|
||||||
|
<view class="flex-row items-center mt-38">
|
||||||
|
<view class="flex-row items-center group_5">
|
||||||
|
<text class="text_5">138.</text>
|
||||||
|
<image
|
||||||
|
class="image_5 image_6"
|
||||||
|
src="https://ide.code.fun/api/image?token=6726d42bc471750012ddd6db&name=4223cdafed72fca52c442dae885cee9c.png"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
<text class="font_3 text_6">00</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<text class="font text_7">×1</text>
|
||||||
|
</view>
|
||||||
|
<view class="flex-row justify-between items-center self-stretch view">
|
||||||
|
<text class="font_4 text_8">商品总价</text>
|
||||||
|
<view class="flex-row items-center">
|
||||||
|
<image
|
||||||
|
class="shrink-0 image_5"
|
||||||
|
src="https://ide.code.fun/api/image?token=6726d42bc471750012ddd6db&name=4223cdafed72fca52c442dae885cee9c.png"
|
||||||
|
/>
|
||||||
|
<text class="font_3 text_9">138.00</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="flex-row justify-between items-center self-stretch view_2">
|
||||||
|
<text class="font_4 text_10">优惠券</text>
|
||||||
|
<view class="flex-row items-center group_1">
|
||||||
|
<image
|
||||||
|
class="shrink-0 image_7"
|
||||||
|
src="https://ide.code.fun/api/image?token=6726d42bc471750012ddd6db&name=40498ff9c7a50c056417f381edf937db.png"
|
||||||
|
/>
|
||||||
|
<text class="font_3 text_11">50.00</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="flex-row justify-end items-center self-stretch group_7">
|
||||||
|
<view class="flex-row items-center group_8">
|
||||||
|
<image
|
||||||
|
class="image_5 image_8"
|
||||||
|
src="https://ide.code.fun/api/image?token=6726d42bc471750012ddd6db&name=f1d048b70eca2a37b0db8f3bd9989205.png"
|
||||||
|
/>
|
||||||
|
<text class="font text_12">应付款:</text>
|
||||||
|
</view>
|
||||||
|
<text class="font_3 text_13">88.00</text>
|
||||||
|
</view>
|
||||||
|
<view class="self-stretch divider view_3"></view>
|
||||||
|
<text class="self-start font_4 text_14">买家留言</text>
|
||||||
|
<view class="flex-col justify-start self-stretch text-wrapper">
|
||||||
|
<text class="font_2 text_15">
|
||||||
|
希望所使用的材料是可持续来源的,并且制作工艺要精细,以确保每一朵花瓣都能生动地展现出绒花的质感和美感。
|
||||||
|
</text>
|
||||||
|
</view>
|
||||||
|
<view class="self-stretch divider view_4"></view>
|
||||||
|
<view class="flex-row justify-between self-stretch view_5">
|
||||||
|
<text class="font_2 text_16">订单编号:</text>
|
||||||
|
<view class="flex-row items-center group_9">
|
||||||
|
<text class="font_5 text_17">E20241005095840091406189</text>
|
||||||
|
<view class="flex-col justify-start items-center shrink-0 text-wrapper_2 ml-2">
|
||||||
|
<text class="text_18">复制</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="flex-row justify-between items-center self-stretch view_6">
|
||||||
|
<text class="font_2 text_19">创建时间:</text>
|
||||||
|
<text class="font_5 text_20">2024-10-05 09:58:41</text>
|
||||||
|
</view>
|
||||||
|
<view class="flex-row justify-center items-center self-stretch group_10">
|
||||||
|
<image
|
||||||
|
class="image_9"
|
||||||
|
src="https://ide.code.fun/api/image?token=6726d42bc471750012ddd6db&name=cc4704a44066566fbb28b63075652a13.png"
|
||||||
|
/>
|
||||||
|
<text class="font_6 text_21 ml-6">在线客服</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="flex-col mt-39">
|
||||||
|
<view class="flex-row justify-center items-center">
|
||||||
|
<image
|
||||||
|
class="image_10"
|
||||||
|
src="https://ide.code.fun/api/image?token=6726d42bc471750012ddd6db&name=c75d4968e5a28aab5e0de8c473671ccd.png"
|
||||||
|
/>
|
||||||
|
<text class="font_6 text_22 ml-11">更多精选商品</text>
|
||||||
|
<image
|
||||||
|
class="image_10 ml-11"
|
||||||
|
src="https://ide.code.fun/api/image?token=6726d42bc471750012ddd6db&name=a2da074d4ef9d1f137e125f07493b694.png"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
<view class="grid mt-19">
|
||||||
|
<view class="flex-col grid-item" v-for="(item, index) in items" :key="index">
|
||||||
|
<image
|
||||||
|
class="shrink-0 image_11"
|
||||||
|
src="https://ide.code.fun/api/image?token=6726d42bc471750012ddd6db&name=7c9880424aaae74738a71288cee2f8ee.png"
|
||||||
|
/>
|
||||||
|
<text class="font_7 text_23">【非遗手工艺体验】玉雕-古法制玉体验</text>
|
||||||
|
<view class="flex-row items-center group_11">
|
||||||
|
<image
|
||||||
|
class="image_12"
|
||||||
|
src="https://ide.code.fun/api/image?token=6726d42bc471750012ddd6db&name=rmb.png"
|
||||||
|
/>
|
||||||
|
<text class="font_8">99.00</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="section_4 mt-64"></view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { ref } from 'vue'
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.ml-7 {
|
||||||
|
margin-left: 13.13rpx;
|
||||||
|
}
|
||||||
|
.mt-9 {
|
||||||
|
margin-top: 16.88rpx;
|
||||||
|
}
|
||||||
|
.ml-17 {
|
||||||
|
margin-left: 31.88rpx;
|
||||||
|
}
|
||||||
|
.mt-11 {
|
||||||
|
margin-top: 20.63rpx;
|
||||||
|
}
|
||||||
|
.mt-39 {
|
||||||
|
margin-top: 73.13rpx;
|
||||||
|
}
|
||||||
|
.ml-11 {
|
||||||
|
margin-left: 20.63rpx;
|
||||||
|
}
|
||||||
|
.mt-19 {
|
||||||
|
margin-top: 35.63rpx;
|
||||||
|
}
|
||||||
|
.page {
|
||||||
|
background-color: #fffaf0;
|
||||||
|
width: 100%;
|
||||||
|
overflow-y: auto;
|
||||||
|
overflow-x: hidden;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
.image-wrapper {
|
||||||
|
padding: 15rpx 0;
|
||||||
|
background-color: #a0522d;
|
||||||
|
}
|
||||||
|
.image {
|
||||||
|
margin-left: 16.88rpx;
|
||||||
|
width: 37.5rpx;
|
||||||
|
height: 37.5rpx;
|
||||||
|
}
|
||||||
|
.group {
|
||||||
|
padding-left: 16.41rpx;
|
||||||
|
padding-right: 13.59rpx;
|
||||||
|
}
|
||||||
|
.group_2 {
|
||||||
|
padding: 15rpx 0;
|
||||||
|
}
|
||||||
|
.section {
|
||||||
|
padding: 20.49rpx 26.12rpx 22.63rpx;
|
||||||
|
background-color: #ffffff;
|
||||||
|
border-radius: 18.75rpx;
|
||||||
|
border: solid 1.88rpx #818181;
|
||||||
|
}
|
||||||
|
.image_2 {
|
||||||
|
width: 61.88rpx;
|
||||||
|
height: 61.88rpx;
|
||||||
|
}
|
||||||
|
.font {
|
||||||
|
font-size: 26.25rpx;
|
||||||
|
font-family: Open Sans;
|
||||||
|
line-height: 24.43rpx;
|
||||||
|
color: #323232;
|
||||||
|
}
|
||||||
|
.text {
|
||||||
|
color: #323233;
|
||||||
|
font-size: 28.13rpx;
|
||||||
|
line-height: 26.08rpx;
|
||||||
|
}
|
||||||
|
.section_2 {
|
||||||
|
padding: 32.72rpx 14.94rpx 31.99rpx 18.68rpx;
|
||||||
|
background-color: #ffffff;
|
||||||
|
border-radius: 18.75rpx;
|
||||||
|
border: solid 1.88rpx #818181;
|
||||||
|
}
|
||||||
|
.image_3 {
|
||||||
|
width: 43.13rpx;
|
||||||
|
height: 43.13rpx;
|
||||||
|
}
|
||||||
|
.text_2 {
|
||||||
|
line-height: 23.77rpx;
|
||||||
|
}
|
||||||
|
.font_2 {
|
||||||
|
font-size: 22.5rpx;
|
||||||
|
font-family: Open Sans;
|
||||||
|
line-height: 20.68rpx;
|
||||||
|
color: #818181;
|
||||||
|
}
|
||||||
|
.text_3 {
|
||||||
|
line-height: 20.91rpx;
|
||||||
|
}
|
||||||
|
.section_3 {
|
||||||
|
padding: 0 14.89rpx 18.88rpx 18.62rpx;
|
||||||
|
background-color: #ffffff;
|
||||||
|
border-radius: 18.75rpx;
|
||||||
|
border: solid 1.88rpx #818181;
|
||||||
|
}
|
||||||
|
.group_3 {
|
||||||
|
padding: 20.49rpx 3.75rpx 18.75rpx;
|
||||||
|
border-bottom: solid 1.88rpx #dfdfdf;
|
||||||
|
}
|
||||||
|
.image_4 {
|
||||||
|
margin-bottom: 5.63rpx;
|
||||||
|
border-radius: 9.38rpx;
|
||||||
|
width: 146.25rpx;
|
||||||
|
height: 165rpx;
|
||||||
|
}
|
||||||
|
.group_4 {
|
||||||
|
margin-top: 4.07rpx;
|
||||||
|
}
|
||||||
|
.text_4 {
|
||||||
|
margin-left: 2.1rpx;
|
||||||
|
line-height: 20.79rpx;
|
||||||
|
}
|
||||||
|
.group_5 {
|
||||||
|
width: 90.66rpx;
|
||||||
|
}
|
||||||
|
.text_5 {
|
||||||
|
margin-left: 25.03rpx;
|
||||||
|
color: #323232;
|
||||||
|
font-size: 33.75rpx;
|
||||||
|
font-family: Open Sans;
|
||||||
|
font-weight: 600;
|
||||||
|
line-height: 24.88rpx;
|
||||||
|
}
|
||||||
|
.image_5 {
|
||||||
|
width: 30rpx;
|
||||||
|
height: 30rpx;
|
||||||
|
}
|
||||||
|
.image_6 {
|
||||||
|
margin-left: -90.66rpx;
|
||||||
|
}
|
||||||
|
.font_3 {
|
||||||
|
font-size: 26.25rpx;
|
||||||
|
font-family: Open Sans;
|
||||||
|
line-height: 20.68rpx;
|
||||||
|
color: #323232;
|
||||||
|
}
|
||||||
|
.text_6 {
|
||||||
|
font-weight: 600;
|
||||||
|
line-height: 19.29rpx;
|
||||||
|
}
|
||||||
|
.text_7 {
|
||||||
|
margin-right: 9.83rpx;
|
||||||
|
margin-bottom: 7.5rpx;
|
||||||
|
line-height: 18.73rpx;
|
||||||
|
}
|
||||||
|
.view {
|
||||||
|
margin-top: 26.25rpx;
|
||||||
|
padding: 0 5.53rpx;
|
||||||
|
}
|
||||||
|
.font_4 {
|
||||||
|
font-size: 26.25rpx;
|
||||||
|
font-family: Open Sans;
|
||||||
|
line-height: 24.43rpx;
|
||||||
|
color: #818181;
|
||||||
|
}
|
||||||
|
.text_8 {
|
||||||
|
line-height: 24.36rpx;
|
||||||
|
}
|
||||||
|
.text_9 {
|
||||||
|
line-height: 19.39rpx;
|
||||||
|
}
|
||||||
|
.view_2 {
|
||||||
|
margin-top: 13.13rpx;
|
||||||
|
padding: 0 4.69rpx;
|
||||||
|
}
|
||||||
|
.text_10 {
|
||||||
|
line-height: 24.26rpx;
|
||||||
|
}
|
||||||
|
.group_1 {
|
||||||
|
margin-right: 2.72rpx;
|
||||||
|
}
|
||||||
|
.image_7 {
|
||||||
|
width: 41.25rpx;
|
||||||
|
height: 30rpx;
|
||||||
|
}
|
||||||
|
.text_11 {
|
||||||
|
line-height: 19.39rpx;
|
||||||
|
}
|
||||||
|
.group_7 {
|
||||||
|
margin-top: 16.88rpx;
|
||||||
|
padding: 0 5.91rpx;
|
||||||
|
}
|
||||||
|
.group_8 {
|
||||||
|
width: 128.44rpx;
|
||||||
|
}
|
||||||
|
.image_8 {
|
||||||
|
margin-left: 98.44rpx;
|
||||||
|
}
|
||||||
|
.text_12 {
|
||||||
|
margin-left: -128.44rpx;
|
||||||
|
line-height: 24.54rpx;
|
||||||
|
}
|
||||||
|
.text_13 {
|
||||||
|
color: #fb8b05;
|
||||||
|
line-height: 19.39rpx;
|
||||||
|
}
|
||||||
|
.divider {
|
||||||
|
background-color: #dfdfdf;
|
||||||
|
height: 1.88rpx;
|
||||||
|
}
|
||||||
|
.view_3 {
|
||||||
|
margin: 16.88rpx 9.62rpx 0 3.75rpx;
|
||||||
|
}
|
||||||
|
.text_14 {
|
||||||
|
margin-left: 5.16rpx;
|
||||||
|
margin-top: 24.86rpx;
|
||||||
|
line-height: 24.21rpx;
|
||||||
|
}
|
||||||
|
.text-wrapper {
|
||||||
|
margin-right: 13.37rpx;
|
||||||
|
margin-top: 16.56rpx;
|
||||||
|
padding: 14.64rpx 0 9.77rpx;
|
||||||
|
background-color: #ffffff;
|
||||||
|
border-radius: 9.38rpx;
|
||||||
|
border: solid 1.88rpx #f1f1b5;
|
||||||
|
}
|
||||||
|
.text_15 {
|
||||||
|
margin-left: 15.37rpx;
|
||||||
|
margin-right: 20.27rpx;
|
||||||
|
line-height: 26.25rpx;
|
||||||
|
}
|
||||||
|
.view_4 {
|
||||||
|
margin: 18.75rpx 9.62rpx 0 3.75rpx;
|
||||||
|
}
|
||||||
|
.view_5 {
|
||||||
|
margin-top: 24.09rpx;
|
||||||
|
padding: 0 4.88rpx;
|
||||||
|
}
|
||||||
|
.text_16 {
|
||||||
|
line-height: 20.85rpx;
|
||||||
|
}
|
||||||
|
.group_9 {
|
||||||
|
margin-right: 4.74rpx;
|
||||||
|
}
|
||||||
|
.font_5 {
|
||||||
|
font-size: 22.5rpx;
|
||||||
|
font-family: Open Sans;
|
||||||
|
color: #323232;
|
||||||
|
}
|
||||||
|
.text_17 {
|
||||||
|
line-height: 16.54rpx;
|
||||||
|
}
|
||||||
|
.text-wrapper_2 {
|
||||||
|
padding-bottom: 2.29rpx;
|
||||||
|
background-color: #fffef8;
|
||||||
|
width: 50.63rpx;
|
||||||
|
height: 22.5rpx;
|
||||||
|
border: solid 0.94rpx #d1d1d1;
|
||||||
|
}
|
||||||
|
.text_18 {
|
||||||
|
color: #323232;
|
||||||
|
font-size: 18.75rpx;
|
||||||
|
font-family: Open Sans;
|
||||||
|
line-height: 17.38rpx;
|
||||||
|
}
|
||||||
|
.view_6 {
|
||||||
|
margin-top: 11.16rpx;
|
||||||
|
padding: 0 4.35rpx;
|
||||||
|
}
|
||||||
|
.text_19 {
|
||||||
|
line-height: 20.7rpx;
|
||||||
|
}
|
||||||
|
.text_20 {
|
||||||
|
margin-right: 157.91rpx;
|
||||||
|
line-height: 16.63rpx;
|
||||||
|
}
|
||||||
|
.group_10 {
|
||||||
|
margin-top: 27.81rpx;
|
||||||
|
}
|
||||||
|
.image_9 {
|
||||||
|
width: 45rpx;
|
||||||
|
height: 45rpx;
|
||||||
|
}
|
||||||
|
.font_6 {
|
||||||
|
font-size: 30rpx;
|
||||||
|
font-family: Open Sans;
|
||||||
|
color: #323232;
|
||||||
|
}
|
||||||
|
.text_21 {
|
||||||
|
line-height: 27.69rpx;
|
||||||
|
}
|
||||||
|
.image_10 {
|
||||||
|
width: 251.25rpx;
|
||||||
|
height: 1.88rpx;
|
||||||
|
}
|
||||||
|
.text_22 {
|
||||||
|
line-height: 27.71rpx;
|
||||||
|
}
|
||||||
|
.grid {
|
||||||
|
margin-left: 11.72rpx;
|
||||||
|
margin-right: 14.53rpx;
|
||||||
|
height: 965.63rpx;
|
||||||
|
display: grid;
|
||||||
|
grid-template-rows: repeat(2, minmax(0, 1fr));
|
||||||
|
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||||
|
row-gap: 30.13rpx;
|
||||||
|
column-gap: 28.26rpx;
|
||||||
|
}
|
||||||
|
.grid-item {
|
||||||
|
padding-bottom: 28.26rpx;
|
||||||
|
background-color: #ffffff;
|
||||||
|
border-radius: 18.75rpx;
|
||||||
|
border: solid 1.88rpx #818181;
|
||||||
|
}
|
||||||
|
.image_11 {
|
||||||
|
border-radius: 18.75rpx 18.75rpx 0rpx 0rpx;
|
||||||
|
width: 333.75rpx;
|
||||||
|
height: 322.5rpx;
|
||||||
|
}
|
||||||
|
.font_7 {
|
||||||
|
font-size: 26.25rpx;
|
||||||
|
font-family: Open Sans;
|
||||||
|
line-height: 30rpx;
|
||||||
|
color: #000000;
|
||||||
|
}
|
||||||
|
.text_23 {
|
||||||
|
margin: 8.42rpx 6.69rpx 0 12.06rpx;
|
||||||
|
font-size: 24.38rpx;
|
||||||
|
}
|
||||||
|
.group_11 {
|
||||||
|
margin-top: 17.83rpx;
|
||||||
|
padding: 0 22.37rpx;
|
||||||
|
}
|
||||||
|
.image_12 {
|
||||||
|
width: 26.25rpx;
|
||||||
|
height: 26.25rpx;
|
||||||
|
}
|
||||||
|
.font_8 {
|
||||||
|
font-size: 30rpx;
|
||||||
|
font-family: Times New Roman;
|
||||||
|
line-height: 20.68rpx;
|
||||||
|
color: #fbb612;
|
||||||
|
}
|
||||||
|
.section_4 {
|
||||||
|
background-color: #ffffff;
|
||||||
|
height: 103.13rpx;
|
||||||
|
}
|
||||||
|
@import url(../../../common/css/global.css);
|
||||||
|
</style>
|
|
@ -12,7 +12,7 @@
|
||||||
</view>
|
</view>
|
||||||
<image
|
<image
|
||||||
class="image"
|
class="image"
|
||||||
:src="zhuye"
|
:src="productObject.goodImg"
|
||||||
/>
|
/>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex-row items-center group_2">
|
<view class="flex-row items-center group_2">
|
||||||
|
@ -47,10 +47,10 @@
|
||||||
<view class="flex-col section_3">
|
<view class="flex-col section_3">
|
||||||
<view class="self-start group_4">
|
<view class="self-start group_4">
|
||||||
<text class="text_3 text_5">¥</text>
|
<text class="text_3 text_5">¥</text>
|
||||||
<text class="text_3 text_4">750</text>
|
<text class="text_3 text_4">{{ productObject.price }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex-row justify-between items-center self-stretch group_5">
|
<view class="flex-row justify-between items-center self-stretch group_5">
|
||||||
<text class="text_3 text_7">琉璃发簪新手体验包</text>
|
<text class="text_3 text_7">{{ productObject.name }}</text>
|
||||||
<view class="flex-row items-center group_6">
|
<view class="flex-row items-center group_6">
|
||||||
<image
|
<image
|
||||||
class="shrink-0 image_2"
|
class="shrink-0 image_2"
|
||||||
|
@ -62,7 +62,7 @@
|
||||||
<view class="self-stretch divider view"></view>
|
<view class="self-stretch divider view"></view>
|
||||||
<view class="flex-col self-start group_7">
|
<view class="flex-col self-start group_7">
|
||||||
<text class="self-stretch font_4 text_3">
|
<text class="self-stretch font_4 text_3">
|
||||||
商品简介:{{ detail }}
|
商品简介:{{ productObject.introDetail }}
|
||||||
<!-- <br /> -->
|
<!-- <br /> -->
|
||||||
</text>
|
</text>
|
||||||
<!-- <text class="mt-2 self-stretch font_4 text_3">发簪不仅美观大方,还有 着深厚的文化底蕴。购买体验包,</text>
|
<!-- <text class="mt-2 self-stretch font_4 text_3">发簪不仅美观大方,还有 着深厚的文化底蕴。购买体验包,</text>
|
||||||
|
@ -71,14 +71,9 @@
|
||||||
<view class="self-stretch divider view_2"></view>
|
<view class="self-stretch divider view_2"></view>
|
||||||
<view class="flex-row items-center self-stretch group_8">
|
<view class="flex-row items-center self-stretch group_8">
|
||||||
<text class="font_3 text_3 text_8">商品标签:</text>
|
<text class="font_3 text_3 text_8">商品标签:</text>
|
||||||
<view class="flex-col justify-start items-center text-wrapper ml-7">
|
<view class="flex-col justify-start items-center text-wrapper ml-7" v-for="(item , index) in labelList" :key="index">
|
||||||
<text class="font_5 text_9">#{{ arr_tag[0] }}</text>
|
<text class="font_5 text_9">#{{ labelList[index] }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex-col justify-start text-wrapper_2 ml-7"><text class="font_5 text_10">#{{ arr_tag[1] }}</text></view>
|
|
||||||
<view class="flex-col justify-start text-wrapper_2 ml-7">
|
|
||||||
<text class="font_5 text_10 text_11">#{{ arr_tag[2] }}</text>
|
|
||||||
</view>
|
|
||||||
<view class="flex-col justify-start items-center text-wrapper_3 ml-7"><text class="font_5">#{{ arr_tag[3] }}</text></view>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="mt-12 flex-col section_4">
|
<view class="mt-12 flex-col section_4">
|
||||||
|
@ -117,27 +112,35 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup >
|
||||||
import {ref} from 'vue'
|
import {onMounted, ref} from 'vue'
|
||||||
import denglong from '@/pages/store-home/ProductDetails/img/denglong.png';
|
import { onLoad } from "@dcloudio/uni-app";
|
||||||
import haibao from '@/pages/store-home/ProductDetails/img/haibao.png';
|
import denglong from '@/pages/store-home/ProductDetails/img/denglong.png';
|
||||||
import kefu from '@/pages/store-home/ProductDetails/img/kefu.png';
|
import haibao from '@/pages/store-home/ProductDetails/img/haibao.png';
|
||||||
import show1 from '@/pages/store-home/ProductDetails/img/show1.png';
|
import kefu from '@/pages/store-home/ProductDetails/img/kefu.png';
|
||||||
import show2 from '@/pages/store-home/ProductDetails/img/show2.png';
|
import show1 from '@/pages/store-home/ProductDetails/img/show1.png';
|
||||||
import show3 from '@/pages/store-home/ProductDetails/img/show3.png';
|
import show2 from '@/pages/store-home/ProductDetails/img/show2.png';
|
||||||
import show4 from '@/pages/store-home/ProductDetails/img/show4.png';
|
import show3 from '@/pages/store-home/ProductDetails/img/show3.png';
|
||||||
import zhuye from '@/pages/store-home/ProductDetails/img/zhuye.png';
|
import show4 from '@/pages/store-home/ProductDetails/img/show4.png';
|
||||||
const value = ref(750)
|
import emitter from '../../utils/emitter';
|
||||||
const product_name = ref('琉璃发簪新手体验包')
|
const productObject = ref({}) //商品对象
|
||||||
const detail = ref('琉璃发簪便是汉代美人常常佩戴的发饰之一。琉璃发簪不仅美观大方,还有 着深厚的文化底蕴。购买体验包,即可体验古代文化。')
|
const labelList = ref([])
|
||||||
const arr_tag = ref(['发簪','送亲友','体验包','友情'])
|
//转换上一页面传来的商品
|
||||||
const jump_buy =()=> {
|
onLoad((options) => {
|
||||||
uni.navigateTo({
|
productObject.value = JSON.parse(options.info); //将string转为objec赋值给商品对象
|
||||||
url: '../../../pages/order/product-waitpay/product-waitpay'
|
labelList.value = productObject.value.label.split(";") //分割字符串,生成标签数组
|
||||||
})
|
labelList.value = labelList.value.filter((s)=>{ //使用filter将最后一个空值去掉
|
||||||
}
|
return s
|
||||||
|
})
|
||||||
|
})
|
||||||
|
const jump_buy =()=> {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '../../../pages/order/product-waitpay/product-waitpay?product=' + JSON.stringify(productObject.value)
|
||||||
|
})
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user