@v-c/select 1.2.3 → 1.2.4

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.
Files changed (2) hide show
  1. package/dist/OptionList.js +14 -2
  2. package/package.json +3 -3
@@ -23,9 +23,21 @@ var OptionList = /* @__PURE__ */ defineComponent({
23
23
  const baseProps = useBaseProps();
24
24
  const context = useSelectContext();
25
25
  const itemPrefixCls = computed(() => `${baseProps.value?.prefixCls}-item`);
26
+ const cacheRef = shallowRef({
27
+ value: context.value?.flattenOptions || [],
28
+ condition: [!!baseProps.value?.open, !!baseProps.value?.lockOptions]
29
+ });
26
30
  const memoFlattenOptions = computed(() => {
27
- if (!baseProps.value?.open) return context.value?.flattenOptions || [];
28
- return context.value?.flattenOptions || [];
31
+ const nextCondition = [!!baseProps.value?.open, !!baseProps.value?.lockOptions];
32
+ const nextValue = context.value?.flattenOptions || [];
33
+ if (nextCondition[0] && !nextCondition[1]) {
34
+ cacheRef.value = {
35
+ value: nextValue,
36
+ condition: nextCondition
37
+ };
38
+ return nextValue;
39
+ }
40
+ return cacheRef.value.value;
29
41
  });
30
42
  const listRef = shallowRef(null);
31
43
  const overMaxCount = computed(() => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@v-c/select",
3
3
  "type": "module",
4
- "version": "1.2.3",
4
+ "version": "1.2.4",
5
5
  "description": "",
6
6
  "author": "",
7
7
  "license": "MIT",
@@ -36,8 +36,8 @@
36
36
  "dependencies": {
37
37
  "@v-c/overflow": "^1.1.1",
38
38
  "@v-c/trigger": "^1.1.0",
39
- "@v-c/virtual-list": "^1.1.1",
40
- "@v-c/util": "^1.1.0"
39
+ "@v-c/util": "^1.1.0",
40
+ "@v-c/virtual-list": "^1.1.1"
41
41
  },
42
42
  "scripts": {
43
43
  "build": "vite build",