@reviewpush/rp-treeselect 0.0.7 → 0.0.9

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reviewpush/rp-treeselect",
3
- "version": "0.0.7",
3
+ "version": "0.0.9",
4
4
  "repository": "reviewpush/rp-treeselect",
5
5
  "main": "dist/rp-treeselect.cjs.js",
6
6
  "unpkg": "dist/rp-treeselect.umd.min.js",
@@ -20,6 +20,7 @@
20
20
  },
21
21
 
22
22
  render() {
23
+ console.log(this)
23
24
  if (!this.instance.name || this.instance.disabled || !this.instance.hasValue) return null
24
25
 
25
26
  let stringifiedValues = this.instance.internalValue.map(stringifyValue)
@@ -1,11 +1,14 @@
1
1
  <script>
2
- import Vue from 'vue'
2
+ import { inject, createApp } from 'vue'
3
3
  import { watchSize, setupResizeAndScrollEventListeners, find } from '../utils'
4
4
  import Menu from './Menu'
5
5
 
6
6
  const PortalTarget = {
7
7
  name: 'rp-treeselect--portal-target',
8
- inject: [ 'instance' ],
8
+ setup() {
9
+ const instance = inject('instance')
10
+ return { instance }
11
+ },
9
12
 
10
13
  watch: {
11
14
  'instance.menu.isOpen'(newValue) {
@@ -152,7 +155,7 @@
152
155
  const el = document.createElement('div')
153
156
  document.body.appendChild(el)
154
157
 
155
- this.portalTarget = new Vue({
158
+ this.portalTarget = createApp({
156
159
  el,
157
160
  parent: this,
158
161
  ...PortalTarget,
@@ -1,4 +1,5 @@
1
1
  <script>
2
+ import { inject } from 'vue'
2
3
  import { UNCHECKED, INDETERMINATE, CHECKED } from '../constants'
3
4
  import { onLeftClick } from '../utils'
4
5
  import Tip from './Tip'
@@ -8,7 +9,10 @@
8
9
 
9
10
  const Option = {
10
11
  name: 'rp-treeselect--option',
11
- inject: [ 'instance' ],
12
+ setup() {
13
+ const instance = inject('instance')
14
+ return { instance }
15
+ },
12
16
 
13
17
  props: {
14
18
  node: {
@@ -68,10 +68,6 @@
68
68
  export default {
69
69
  name: 'rp-treeselect',
70
70
 
71
- setup() {
72
- provide('instance', this)
73
- },
74
-
75
71
  props: {
76
72
  /**
77
73
  * Whether to allow resetting value even if there are disabled selected nodes.
@@ -906,6 +902,8 @@
906
902
  created() {
907
903
  this.verifyProps()
908
904
  this.resetFlags()
905
+
906
+ provide('instance', this)
909
907
  },
910
908
 
911
909
  mounted() {