Skip to content

Commit d357443

Browse files
authored
Revert "chore: use vue-demi for backward compat with vue2 (#70)" (#80)
1 parent 2fbcb53 commit d357443

File tree

7 files changed

+22
-48
lines changed

7 files changed

+22
-48
lines changed

README.md

+1-9
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
![GIF of the demo being used](./readme/demo.gif)
66

7-
This is a thin wrapper around the great [SortableJS](https://github.com/SortableJS/Sortable) library for Vue 2 & 3. I had many issues migrating from Vue.Draggable to vue.draggable.next, and after briefly investigating I decided that it was too complicated and a smaller solution was the answer. This wrapper attempts to keep you as close to Sortable as possible.
7+
This is a thin wrapper around the great [SortableJS](https://github.com/SortableJS/Sortable) library. I had many issues migrating from Vue.Draggable to vue.draggable.next, and after briefly investigating I decided that it was too complicated and a smaller solution was the answer. This wrapper attempts to keep you as close to Sortable as possible.
88

99
### Why not use \<other library\>?
1010

@@ -124,14 +124,6 @@ onEnd(event) { moveItemInArray(store.state.items, event.oldIndex, event.newIndex
124124

125125
You may also want to see the SortableJS store documentation [here](https://github.com/SortableJS/Sortable#store).
126126

127-
## Vue 2 support
128-
129-
If you are using version prior to `[email protected]`, `@vue/composition-api` is required to be installed to use SortableJS-vue3 with Vue 2.
130-
131-
Everything else should be similar to the example above for Vue 3.
132-
133-
Under the hood, we use [Vue Demi](https://github.com/vueuse/vue-demi) a tool that allows us to write Universal Vue Libraries for Vue 2 & 3.
134-
135127
## Development
136128

137129
1. Run `yarn` to install dependencies

package.json

+2-8
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,11 @@
3636
},
3737
"dependencies": {
3838
"sortablejs": "^1.15.0",
39-
"vue": "^3.2.37",
40-
"vue-demi": "^0.13.11"
39+
"vue": "^3.2.37"
4140
},
4241
"peerDependencies": {
4342
"sortablejs": "^1.15.0",
44-
"vue": "^2.0.0 || >=3.0.0"
45-
},
46-
"peerDependenciesMeta": {
47-
"@vue/composition-api": {
48-
"optional": true
49-
}
43+
"vue": "^3.2.25"
5044
},
5145
"devDependencies": {
5246
"@types/node": "18.14.2",

pnpm-lock.yaml

+16-25
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/HelloWorld.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script setup lang="ts">
22
import Sortable from "./Sortable.vue";
3-
import { computed, ref } from "vue-demi";
3+
import { computed, ref } from "vue";
44
import type { SortableOptions } from "sortablejs";
55
import type { AutoScrollOptions } from "sortablejs/plugins";
66

src/components/Sortable.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script setup lang="ts">
2-
import { ref, PropType, watch, onUnmounted, computed, useAttrs, Ref } from "vue-demi";
2+
import { ref, PropType, watch, onUnmounted, computed, useAttrs, Ref } from "vue";
33
import Sortable, { SortableOptions } from "sortablejs";
44
import type { AutoScrollOptions } from "sortablejs/plugins";
55

src/main.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { createApp } from "vue-demi";
1+
import { createApp } from "vue";
22
import App from "./App.vue";
33

44
createApp(App).mount("#app");

vite.config.ts

-3
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ export default defineConfig({
1010
preserveSymlinks: false,
1111
},
1212
logLevel: "info",
13-
optimizeDeps: {
14-
exclude: ['vue-demi']
15-
},
1613
build: {
1714
target: "esnext",
1815
minify: "terser",

0 commit comments

Comments
 (0)