@splicetree/adapter-vue 0.0.1 → 0.1.0

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 CHANGED
@@ -1,17 +1,17 @@
1
1
  # @splicetree/adapter-vue
2
2
 
3
+ ## 简介
4
+
5
+ SpliceTree Vue 适配层,将核心 `items()` 适配为 `shallowRef` 响应式数据,并复用核心 API。
6
+
7
+ 提供响应式 `items` 与操作方法,自动监听核心事件刷新视图。
8
+
3
9
  [![version](https://img.shields.io/npm/v/@splicetree/adapter-vue.svg?label=version)](https://www.npmjs.com/package/@splicetree/adapter-vue)
4
10
  [![downloads](https://img.shields.io/npm/dm/@splicetree/adapter-vue.svg)](https://npmcharts.com/compare/%40splicetree%2Fadapter-vue?minimal=true)
5
11
  [![license](https://img.shields.io/npm/l/@splicetree/adapter-vue.svg)](https://www.npmjs.com/package/@splicetree/adapter-vue)
6
12
  [![Website](https://img.shields.io/static/v1?label=Website&message=splicetree.dev&color=blue)](https://www.splicetree.dev)
7
13
  [![GitHub](https://img.shields.io/static/v1?label=GitHub&message=splicetree%2Fsplicetree&logo=github)](https://github.com/michaelcocova/splicetree)
8
14
 
9
- 提供响应式 `items` 与操作方法,自动监听核心事件刷新视图。
10
-
11
- ## 简介
12
-
13
- SpliceTree Vue 适配层,将核心 `items()` 适配为 `shallowRef` 响应式数据,并复用核心 API。
14
-
15
15
  ## 官方文档
16
16
 
17
17
  文档与示例位于 [https://www.splicetree.dev](https://www.splicetree.dev)
package/dist/index.d.ts CHANGED
@@ -2,7 +2,7 @@ import { Ref, ShallowRef, WritableComputedRef } from "vue";
2
2
  import { SpliceTreeData, SpliceTreeData as SpliceTreeData$1, SpliceTreeInstance, SpliceTreeInstance as SpliceTreeInstance$1, SpliceTreeNode, SpliceTreeNode as SpliceTreeNode$1, UseSpliceTreeOptions, UseSpliceTreeOptions as UseSpliceTreeOptions$1 } from "@splicetree/core";
3
3
 
4
4
  //#region src/index.d.ts
5
- interface UseSpliceTreeReturn<T extends SpliceTreeData$1 = SpliceTreeData$1> extends ShallowRef<Omit<SpliceTreeInstance$1<T>, 'items'>> {
5
+ interface UseSpliceTreeReturn<T extends SpliceTreeData$1 = SpliceTreeData$1> extends Omit<SpliceTreeInstance$1<T>, 'items'> {
6
6
  items: ShallowRef<SpliceTreeNode$1<T>[]>;
7
7
  }
8
8
  /**
package/dist/index.js CHANGED
@@ -434,14 +434,15 @@ function useSpliceTree(data, options = {}) {
434
434
  });
435
435
  items.value = api.value.items();
436
436
  };
437
+ createTree();
437
438
  watch(() => toValue(data), () => {
438
439
  createTree();
439
440
  }, {
440
441
  deep: true,
441
- immediate: true
442
+ immediate: false
442
443
  });
443
444
  return {
444
- ...api,
445
+ ...api.value,
445
446
  items
446
447
  };
447
448
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@splicetree/adapter-vue",
3
3
  "type": "module",
4
- "version": "0.0.1",
4
+ "version": "0.1.0",
5
5
  "author": {
6
6
  "email": "michael.cocova@gmail.com",
7
7
  "name": "Michael Cocova"
@@ -31,7 +31,7 @@
31
31
  },
32
32
  "devDependencies": {
33
33
  "vue": "^3.0.0",
34
- "@splicetree/core": "0.0.1"
34
+ "@splicetree/core": "0.1.0"
35
35
  },
36
36
  "publishConfig": {
37
37
  "access": "public"