vue-mount-plugin 1.0.0-alpha.2 → 1.0.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
@@ -35,6 +35,93 @@ $ yarn add vue-mount-plugin
35
35
 
36
36
  ## Usage
37
37
 
38
+ ### Use in Vue `>=3.0`
39
+
40
+ ```vue
41
+ <template>
42
+ <div></div>
43
+ </template>
44
+
45
+ <script setup>
46
+ import { getCurrentInstance } from 'vue'
47
+ import Mount from 'vue-mount-plugin'
48
+ import DemoVue from './demo.vue'
49
+
50
+ const { proxy } = getCurrentInstance()
51
+ const instance = new Mount(DemoVue, { parent: proxy.$root })
52
+
53
+ // mount to the end of document.body
54
+ instance.mount()
55
+
56
+ // destroy
57
+ instance.destroy()
58
+ </script>
59
+ ```
60
+
61
+ ### Use in Vue `2.7`
62
+
63
+ ```vue
64
+ <template>
65
+ <div></div>
66
+ </template>
67
+
68
+ <script>
69
+ import { getCurrentInstance } from 'vue'
70
+ import Mount from 'vue-mount-plugin'
71
+ import DemoVue from './demo.vue'
72
+
73
+ export default {
74
+ setup() {
75
+ const { proxy } = getCurrentInstance()
76
+ const instance = new Mount(DemoVue, { parent: proxy.$root })
77
+
78
+ // mount to the end of document.body
79
+ instance.mount()
80
+
81
+ // destroy
82
+ instance.destroy()
83
+ }
84
+ }
85
+ </script>
86
+ ```
87
+
88
+ ### Use in Vue `<=2.6`
89
+
90
+ > Add `@vue/composition-api` to the `project.json` dependencies and run install.
91
+
92
+ ```json
93
+ {
94
+ "dependencies": {
95
+ "@vue/composition-api": "latest"
96
+ }
97
+ }
98
+ ```
99
+
100
+ ```vue
101
+ <template>
102
+ <div></div>
103
+ </template>
104
+
105
+ <script>
106
+ import { getCurrentInstance } from '@vue/composition-api'
107
+ import Mount from 'vue-mount-plugin'
108
+ import DemoVue from './demo.vue'
109
+
110
+ export default {
111
+ setup() {
112
+ const { proxy } = getCurrentInstance()
113
+ const instance = new Mount(DemoVue, { parent: proxy.$root })
114
+
115
+ // mount to the end of document.body
116
+ instance.mount()
117
+
118
+ // destroy
119
+ instance.destroy()
120
+ }
121
+ }
122
+ </script>
123
+ ```
124
+
38
125
  ## Support & Issues
39
126
 
40
127
  Please open an issue [here](https://github.com/saqqdy/vue-mount-plugin/issues).
package/dist/index.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * vue-mount-plugin v1.0.0-alpha.2
2
+ * vue-mount-plugin v1.0.0
3
3
  * A simple and easy to use vue instance extension plugin that supports vue2.0 and vue3.0
4
4
  * (c) 2021-2023 saqqdy
5
5
  * Released under the MIT License.
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * vue-mount-plugin v1.0.0-alpha.2
2
+ * vue-mount-plugin v1.0.0
3
3
  * A simple and easy to use vue instance extension plugin that supports vue2.0 and vue3.0
4
4
  * (c) 2021-2023 saqqdy
5
5
  * Released under the MIT License.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vue-mount-plugin",
3
3
  "description": "A simple and easy to use vue instance extension plugin that supports vue2.0 and vue3.0",
4
- "version": "1.0.0-alpha.2",
4
+ "version": "1.0.0",
5
5
  "packageManager": "pnpm@7.26.1",
6
6
  "main": "./dist/index.cjs",
7
7
  "module": "./dist/index.mjs",