zl-lcyq 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -82
- package/lib/zl-lcyq.es.js +4 -307
- package/lib/zl-lcyq.umd.js +270 -274
- package/package.json +1 -1
- package/lib/favicon.ico +0 -0
package/README.md
CHANGED
@@ -1,83 +1 @@
|
|
1
|
-
# [vue3-starry-sky](https://www.npmjs.com/package/vue3-starry-sky)
|
2
1
|
|
3
|
-
# 组件下载
|
4
|
-
|
5
|
-
```
|
6
|
-
npm i vue3-starry-sky
|
7
|
-
```
|
8
|
-
|
9
|
-
# 组件效果预览
|
10
|
-
|
11
|
-
* [gitee pages](https://zero-dg.gitee.io/vue3-starry-sky)
|
12
|
-
* [github pages](https://zero-dg.github.io/vue3-starry-sky/)
|
13
|
-
|
14
|
-
# 全局使用方法
|
15
|
-
|
16
|
-
在vue3项目中全局引用的方式
|
17
|
-
``` ts
|
18
|
-
//main.ts or main.js
|
19
|
-
import { createApp } from 'vue';
|
20
|
-
import App from './App.vue';
|
21
|
-
import Vue3StarrySky from 'vue3-starry-sky';
|
22
|
-
import 'vue3-starry-sky/lib/style.css';
|
23
|
-
|
24
|
-
const app = createApp(App);
|
25
|
-
|
26
|
-
app.use(Vue3StarrySky);
|
27
|
-
app.mount('#app');
|
28
|
-
```
|
29
|
-
如果使用ts+vite的方式,需要在env.d.ts中加入最后一句声明,否则ts会检测报错。
|
30
|
-
``` ts
|
31
|
-
/// <reference types="vite/client" />
|
32
|
-
declare module '*.vue' {
|
33
|
-
import type { DefineComponent } from 'vue'
|
34
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
|
35
|
-
const component: DefineComponent<{}, {}, any>
|
36
|
-
export default component
|
37
|
-
}
|
38
|
-
|
39
|
-
declare module 'vue3-starry-sky';
|
40
|
-
```
|
41
|
-
组件内使用
|
42
|
-
``` html
|
43
|
-
<script setup></script>
|
44
|
-
|
45
|
-
<template>
|
46
|
-
<starry-sky :stars-count="1000" :distance="1000" />
|
47
|
-
</template>
|
48
|
-
|
49
|
-
<style></style>
|
50
|
-
```
|
51
|
-
|
52
|
-
# 局部引用方法
|
53
|
-
|
54
|
-
示例:
|
55
|
-
``` html
|
56
|
-
<script setup>
|
57
|
-
import { StarrySky } from '../packages/index';
|
58
|
-
</script>
|
59
|
-
|
60
|
-
<template>
|
61
|
-
<starry-sky :stars-count="1000" :distance="1000" />
|
62
|
-
</template>
|
63
|
-
|
64
|
-
<style></style>
|
65
|
-
```
|
66
|
-
|
67
|
-
# 参数说明
|
68
|
-
|
69
|
-
| 属性 | 类型 | 默认值 |
|
70
|
-
| ---- | ---- | ---- |
|
71
|
-
| stars-count | Number | 800 |
|
72
|
-
| distance | Number | 800 |
|
73
|
-
|
74
|
-
# 源码地址
|
75
|
-
|
76
|
-
* gitee地址:[vue3-starry-sky](https://gitee.com/zero-dg/vue3-starry-sky)
|
77
|
-
* github地址:[vue3-starry-sky](https://github.com/ZERO-DG/vue3-starry-sky)
|
78
|
-
|
79
|
-
# 相关([vue-starry-sky](https://www.npmjs.com/package/vue-starry-sky))
|
80
|
-
|
81
|
-
本项目基于vite+vue3基于之前的cli+vue2升级改造而来,想访问vue2库组件请点击下面链接地址:
|
82
|
-
* gitee地址:[vue-starry-sky](https://gitee.com/zero-dg/vue-starry-sky)
|
83
|
-
* github地址:[vue-starry-sky](https://github.com/ZERO-DG/vue-starry-sky)
|
package/lib/zl-lcyq.es.js
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
import { createTextVNode, Fragment, Comment, isVNode, defineComponent, ref as ref$1, readonly, watch, computed, getCurrentInstance, onMounted, onBeforeUnmount, onBeforeMount, inject, provide, withDirectives, toRef, h, Teleport, nextTick, renderSlot, onActivated, onDeactivated, mergeProps, shallowRef, watchEffect, Transition, TransitionGroup, vShow, cloneVNode, Text, markRaw, reactive, createApp, unref,
|
1
|
+
import { createTextVNode, Fragment, Comment, isVNode, defineComponent, ref as ref$1, readonly, watch, computed, getCurrentInstance, onMounted, onBeforeUnmount, onBeforeMount, inject, provide, withDirectives, toRef, h, Teleport, nextTick, renderSlot, onActivated, onDeactivated, mergeProps, shallowRef, watchEffect, Transition, TransitionGroup, vShow, cloneVNode, Text, markRaw, reactive, createApp, unref, openBlock, createElementBlock, createElementVNode, toDisplayString, createCommentVNode, createVNode, isRef, warn as warn$3, toRefs, withCtx, createBlock, useAttrs, createSlots, normalizeStyle, normalizeClass, onUnmounted, resolveComponent, renderList, useSlots, resolveDynamicComponent, vModelText } from "vue";
|
2
|
+
import { defineStore } from "pinia";
|
2
3
|
let onceCbs = [];
|
3
4
|
const paramsMap = /* @__PURE__ */ new WeakMap();
|
4
5
|
function flushOnceCallbacks() {
|
@@ -5303,7 +5304,7 @@ var funcProto = Function.prototype, objectProto$3 = Object.prototype;
|
|
5303
5304
|
var funcToString = funcProto.toString;
|
5304
5305
|
var hasOwnProperty$4 = objectProto$3.hasOwnProperty;
|
5305
5306
|
var objectCtorString = funcToString.call(Object);
|
5306
|
-
function isPlainObject$
|
5307
|
+
function isPlainObject$1(value) {
|
5307
5308
|
if (!isObjectLike(value) || baseGetTag(value) != objectTag$2) {
|
5308
5309
|
return false;
|
5309
5310
|
}
|
@@ -6007,7 +6008,7 @@ function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, sta
|
|
6007
6008
|
} else {
|
6008
6009
|
newValue = [];
|
6009
6010
|
}
|
6010
|
-
} else if (isPlainObject$
|
6011
|
+
} else if (isPlainObject$1(srcValue) || isArguments$1(srcValue)) {
|
6011
6012
|
newValue = objValue;
|
6012
6013
|
if (isArguments$1(objValue)) {
|
6013
6014
|
newValue = toPlainObject(objValue);
|
@@ -33553,310 +33554,6 @@ var lodash = { exports: {} };
|
|
33553
33554
|
}).call(commonjsGlobal);
|
33554
33555
|
})(lodash, lodash.exports);
|
33555
33556
|
var _ = lodash.exports;
|
33556
|
-
/*!
|
33557
|
-
* pinia v2.3.1
|
33558
|
-
* (c) 2025 Eduardo San Martin Morote
|
33559
|
-
* @license MIT
|
33560
|
-
*/
|
33561
|
-
let activePinia;
|
33562
|
-
const setActivePinia = (pinia) => activePinia = pinia;
|
33563
|
-
const piniaSymbol = Symbol();
|
33564
|
-
function isPlainObject$1(o) {
|
33565
|
-
return o && typeof o === "object" && Object.prototype.toString.call(o) === "[object Object]" && typeof o.toJSON !== "function";
|
33566
|
-
}
|
33567
|
-
var MutationType;
|
33568
|
-
(function(MutationType2) {
|
33569
|
-
MutationType2["direct"] = "direct";
|
33570
|
-
MutationType2["patchObject"] = "patch object";
|
33571
|
-
MutationType2["patchFunction"] = "patch function";
|
33572
|
-
})(MutationType || (MutationType = {}));
|
33573
|
-
const noop$1 = () => {
|
33574
|
-
};
|
33575
|
-
function addSubscription(subscriptions, callback, detached, onCleanup = noop$1) {
|
33576
|
-
subscriptions.push(callback);
|
33577
|
-
const removeSubscription = () => {
|
33578
|
-
const idx = subscriptions.indexOf(callback);
|
33579
|
-
if (idx > -1) {
|
33580
|
-
subscriptions.splice(idx, 1);
|
33581
|
-
onCleanup();
|
33582
|
-
}
|
33583
|
-
};
|
33584
|
-
if (!detached && getCurrentScope()) {
|
33585
|
-
onScopeDispose(removeSubscription);
|
33586
|
-
}
|
33587
|
-
return removeSubscription;
|
33588
|
-
}
|
33589
|
-
function triggerSubscriptions(subscriptions, ...args) {
|
33590
|
-
subscriptions.slice().forEach((callback) => {
|
33591
|
-
callback(...args);
|
33592
|
-
});
|
33593
|
-
}
|
33594
|
-
const fallbackRunWithContext = (fn) => fn();
|
33595
|
-
const ACTION_MARKER = Symbol();
|
33596
|
-
const ACTION_NAME = Symbol();
|
33597
|
-
function mergeReactiveObjects(target, patchToApply) {
|
33598
|
-
if (target instanceof Map && patchToApply instanceof Map) {
|
33599
|
-
patchToApply.forEach((value, key) => target.set(key, value));
|
33600
|
-
} else if (target instanceof Set && patchToApply instanceof Set) {
|
33601
|
-
patchToApply.forEach(target.add, target);
|
33602
|
-
}
|
33603
|
-
for (const key in patchToApply) {
|
33604
|
-
if (!patchToApply.hasOwnProperty(key))
|
33605
|
-
continue;
|
33606
|
-
const subPatch = patchToApply[key];
|
33607
|
-
const targetValue = target[key];
|
33608
|
-
if (isPlainObject$1(targetValue) && isPlainObject$1(subPatch) && target.hasOwnProperty(key) && !isRef(subPatch) && !isReactive(subPatch)) {
|
33609
|
-
target[key] = mergeReactiveObjects(targetValue, subPatch);
|
33610
|
-
} else {
|
33611
|
-
target[key] = subPatch;
|
33612
|
-
}
|
33613
|
-
}
|
33614
|
-
return target;
|
33615
|
-
}
|
33616
|
-
const skipHydrateSymbol = Symbol();
|
33617
|
-
function shouldHydrate(obj) {
|
33618
|
-
return !isPlainObject$1(obj) || !obj.hasOwnProperty(skipHydrateSymbol);
|
33619
|
-
}
|
33620
|
-
const { assign: assign$1 } = Object;
|
33621
|
-
function isComputed(o) {
|
33622
|
-
return !!(isRef(o) && o.effect);
|
33623
|
-
}
|
33624
|
-
function createOptionsStore(id, options, pinia, hot) {
|
33625
|
-
const { state, actions, getters } = options;
|
33626
|
-
const initialState = pinia.state.value[id];
|
33627
|
-
let store;
|
33628
|
-
function setup2() {
|
33629
|
-
if (!initialState && true) {
|
33630
|
-
{
|
33631
|
-
pinia.state.value[id] = state ? state() : {};
|
33632
|
-
}
|
33633
|
-
}
|
33634
|
-
const localState = toRefs(pinia.state.value[id]);
|
33635
|
-
return assign$1(localState, actions, Object.keys(getters || {}).reduce((computedGetters, name) => {
|
33636
|
-
computedGetters[name] = markRaw(computed(() => {
|
33637
|
-
setActivePinia(pinia);
|
33638
|
-
const store2 = pinia._s.get(id);
|
33639
|
-
return getters[name].call(store2, store2);
|
33640
|
-
}));
|
33641
|
-
return computedGetters;
|
33642
|
-
}, {}));
|
33643
|
-
}
|
33644
|
-
store = createSetupStore(id, setup2, options, pinia, hot, true);
|
33645
|
-
return store;
|
33646
|
-
}
|
33647
|
-
function createSetupStore($id, setup2, options = {}, pinia, hot, isOptionsStore) {
|
33648
|
-
let scope;
|
33649
|
-
const optionsForPlugin = assign$1({ actions: {} }, options);
|
33650
|
-
const $subscribeOptions = { deep: true };
|
33651
|
-
let isListening;
|
33652
|
-
let isSyncListening;
|
33653
|
-
let subscriptions = [];
|
33654
|
-
let actionSubscriptions = [];
|
33655
|
-
let debuggerEvents;
|
33656
|
-
const initialState = pinia.state.value[$id];
|
33657
|
-
if (!isOptionsStore && !initialState && true) {
|
33658
|
-
{
|
33659
|
-
pinia.state.value[$id] = {};
|
33660
|
-
}
|
33661
|
-
}
|
33662
|
-
ref$1({});
|
33663
|
-
let activeListener;
|
33664
|
-
function $patch(partialStateOrMutator) {
|
33665
|
-
let subscriptionMutation;
|
33666
|
-
isListening = isSyncListening = false;
|
33667
|
-
if (typeof partialStateOrMutator === "function") {
|
33668
|
-
partialStateOrMutator(pinia.state.value[$id]);
|
33669
|
-
subscriptionMutation = {
|
33670
|
-
type: MutationType.patchFunction,
|
33671
|
-
storeId: $id,
|
33672
|
-
events: debuggerEvents
|
33673
|
-
};
|
33674
|
-
} else {
|
33675
|
-
mergeReactiveObjects(pinia.state.value[$id], partialStateOrMutator);
|
33676
|
-
subscriptionMutation = {
|
33677
|
-
type: MutationType.patchObject,
|
33678
|
-
payload: partialStateOrMutator,
|
33679
|
-
storeId: $id,
|
33680
|
-
events: debuggerEvents
|
33681
|
-
};
|
33682
|
-
}
|
33683
|
-
const myListenerId = activeListener = Symbol();
|
33684
|
-
nextTick().then(() => {
|
33685
|
-
if (activeListener === myListenerId) {
|
33686
|
-
isListening = true;
|
33687
|
-
}
|
33688
|
-
});
|
33689
|
-
isSyncListening = true;
|
33690
|
-
triggerSubscriptions(subscriptions, subscriptionMutation, pinia.state.value[$id]);
|
33691
|
-
}
|
33692
|
-
const $reset = isOptionsStore ? function $reset2() {
|
33693
|
-
const { state } = options;
|
33694
|
-
const newState = state ? state() : {};
|
33695
|
-
this.$patch(($state) => {
|
33696
|
-
assign$1($state, newState);
|
33697
|
-
});
|
33698
|
-
} : noop$1;
|
33699
|
-
function $dispose() {
|
33700
|
-
scope.stop();
|
33701
|
-
subscriptions = [];
|
33702
|
-
actionSubscriptions = [];
|
33703
|
-
pinia._s.delete($id);
|
33704
|
-
}
|
33705
|
-
const action = (fn, name = "") => {
|
33706
|
-
if (ACTION_MARKER in fn) {
|
33707
|
-
fn[ACTION_NAME] = name;
|
33708
|
-
return fn;
|
33709
|
-
}
|
33710
|
-
const wrappedAction = function() {
|
33711
|
-
setActivePinia(pinia);
|
33712
|
-
const args = Array.from(arguments);
|
33713
|
-
const afterCallbackList = [];
|
33714
|
-
const onErrorCallbackList = [];
|
33715
|
-
function after(callback) {
|
33716
|
-
afterCallbackList.push(callback);
|
33717
|
-
}
|
33718
|
-
function onError(callback) {
|
33719
|
-
onErrorCallbackList.push(callback);
|
33720
|
-
}
|
33721
|
-
triggerSubscriptions(actionSubscriptions, {
|
33722
|
-
args,
|
33723
|
-
name: wrappedAction[ACTION_NAME],
|
33724
|
-
store,
|
33725
|
-
after,
|
33726
|
-
onError
|
33727
|
-
});
|
33728
|
-
let ret;
|
33729
|
-
try {
|
33730
|
-
ret = fn.apply(this && this.$id === $id ? this : store, args);
|
33731
|
-
} catch (error2) {
|
33732
|
-
triggerSubscriptions(onErrorCallbackList, error2);
|
33733
|
-
throw error2;
|
33734
|
-
}
|
33735
|
-
if (ret instanceof Promise) {
|
33736
|
-
return ret.then((value) => {
|
33737
|
-
triggerSubscriptions(afterCallbackList, value);
|
33738
|
-
return value;
|
33739
|
-
}).catch((error2) => {
|
33740
|
-
triggerSubscriptions(onErrorCallbackList, error2);
|
33741
|
-
return Promise.reject(error2);
|
33742
|
-
});
|
33743
|
-
}
|
33744
|
-
triggerSubscriptions(afterCallbackList, ret);
|
33745
|
-
return ret;
|
33746
|
-
};
|
33747
|
-
wrappedAction[ACTION_MARKER] = true;
|
33748
|
-
wrappedAction[ACTION_NAME] = name;
|
33749
|
-
return wrappedAction;
|
33750
|
-
};
|
33751
|
-
const partialStore = {
|
33752
|
-
_p: pinia,
|
33753
|
-
$id,
|
33754
|
-
$onAction: addSubscription.bind(null, actionSubscriptions),
|
33755
|
-
$patch,
|
33756
|
-
$reset,
|
33757
|
-
$subscribe(callback, options2 = {}) {
|
33758
|
-
const removeSubscription = addSubscription(subscriptions, callback, options2.detached, () => stopWatcher());
|
33759
|
-
const stopWatcher = scope.run(() => watch(() => pinia.state.value[$id], (state) => {
|
33760
|
-
if (options2.flush === "sync" ? isSyncListening : isListening) {
|
33761
|
-
callback({
|
33762
|
-
storeId: $id,
|
33763
|
-
type: MutationType.direct,
|
33764
|
-
events: debuggerEvents
|
33765
|
-
}, state);
|
33766
|
-
}
|
33767
|
-
}, assign$1({}, $subscribeOptions, options2)));
|
33768
|
-
return removeSubscription;
|
33769
|
-
},
|
33770
|
-
$dispose
|
33771
|
-
};
|
33772
|
-
const store = reactive(partialStore);
|
33773
|
-
pinia._s.set($id, store);
|
33774
|
-
const runWithContext = pinia._a && pinia._a.runWithContext || fallbackRunWithContext;
|
33775
|
-
const setupStore = runWithContext(() => pinia._e.run(() => (scope = effectScope()).run(() => setup2({ action }))));
|
33776
|
-
for (const key in setupStore) {
|
33777
|
-
const prop = setupStore[key];
|
33778
|
-
if (isRef(prop) && !isComputed(prop) || isReactive(prop)) {
|
33779
|
-
if (!isOptionsStore) {
|
33780
|
-
if (initialState && shouldHydrate(prop)) {
|
33781
|
-
if (isRef(prop)) {
|
33782
|
-
prop.value = initialState[key];
|
33783
|
-
} else {
|
33784
|
-
mergeReactiveObjects(prop, initialState[key]);
|
33785
|
-
}
|
33786
|
-
}
|
33787
|
-
{
|
33788
|
-
pinia.state.value[$id][key] = prop;
|
33789
|
-
}
|
33790
|
-
}
|
33791
|
-
} else if (typeof prop === "function") {
|
33792
|
-
const actionValue = action(prop, key);
|
33793
|
-
{
|
33794
|
-
setupStore[key] = actionValue;
|
33795
|
-
}
|
33796
|
-
optionsForPlugin.actions[key] = prop;
|
33797
|
-
} else
|
33798
|
-
;
|
33799
|
-
}
|
33800
|
-
{
|
33801
|
-
assign$1(store, setupStore);
|
33802
|
-
assign$1(toRaw(store), setupStore);
|
33803
|
-
}
|
33804
|
-
Object.defineProperty(store, "$state", {
|
33805
|
-
get: () => pinia.state.value[$id],
|
33806
|
-
set: (state) => {
|
33807
|
-
$patch(($state) => {
|
33808
|
-
assign$1($state, state);
|
33809
|
-
});
|
33810
|
-
}
|
33811
|
-
});
|
33812
|
-
pinia._p.forEach((extender) => {
|
33813
|
-
{
|
33814
|
-
assign$1(store, scope.run(() => extender({
|
33815
|
-
store,
|
33816
|
-
app: pinia._a,
|
33817
|
-
pinia,
|
33818
|
-
options: optionsForPlugin
|
33819
|
-
})));
|
33820
|
-
}
|
33821
|
-
});
|
33822
|
-
if (initialState && isOptionsStore && options.hydrate) {
|
33823
|
-
options.hydrate(store.$state, initialState);
|
33824
|
-
}
|
33825
|
-
isListening = true;
|
33826
|
-
isSyncListening = true;
|
33827
|
-
return store;
|
33828
|
-
}
|
33829
|
-
/*! #__NO_SIDE_EFFECTS__ */
|
33830
|
-
function defineStore(idOrOptions, setup2, setupOptions) {
|
33831
|
-
let id;
|
33832
|
-
let options;
|
33833
|
-
const isSetupStore = typeof setup2 === "function";
|
33834
|
-
if (typeof idOrOptions === "string") {
|
33835
|
-
id = idOrOptions;
|
33836
|
-
options = isSetupStore ? setupOptions : setup2;
|
33837
|
-
} else {
|
33838
|
-
options = idOrOptions;
|
33839
|
-
id = idOrOptions.id;
|
33840
|
-
}
|
33841
|
-
function useStore2(pinia, hot) {
|
33842
|
-
const hasContext = hasInjectionContext();
|
33843
|
-
pinia = pinia || (hasContext ? inject(piniaSymbol, null) : null);
|
33844
|
-
if (pinia)
|
33845
|
-
setActivePinia(pinia);
|
33846
|
-
pinia = activePinia;
|
33847
|
-
if (!pinia._s.has(id)) {
|
33848
|
-
if (isSetupStore) {
|
33849
|
-
createSetupStore(id, setup2, options, pinia);
|
33850
|
-
} else {
|
33851
|
-
createOptionsStore(id, options, pinia);
|
33852
|
-
}
|
33853
|
-
}
|
33854
|
-
const store = pinia._s.get(id);
|
33855
|
-
return store;
|
33856
|
-
}
|
33857
|
-
useStore2.$id = id;
|
33858
|
-
return useStore2;
|
33859
|
-
}
|
33860
33557
|
var nodesConfig = {
|
33861
33558
|
"1": {
|
33862
33559
|
type: 1,
|