Closed microchi closed 3 years ago
@microchi thank you very much for the example. What do you think about the fact that it is only for vue 3? I wanted to be able to use the same library for both versions of Vue.
Maybe split up into different modules?
@microchi Thanks for the great example for working with the Composition API.
But it seems to me that if you use it, it would be an unnecessary wrapper.
You can do a direct import from sweetalert2
library.
import Swal from "sweetalert2";
That would save you the trouble of updating and transpiling.
The current implementation, is more suitable for an older version of Vue. Optional Components. You don't need to do additional imports.
I hope I managed to get my point across. If you agree, I suggest we close this issue.
Dear @avil13
Ok!
How about adding a useVueSweetAlert2 function or jnject directly? There will be "When using "Vue3: Composition API" it is STILL to use this wrapper." And maybe modify readme for the people who use composition api.
Please visit the code sandbox. It implement both! https://codesandbox.io/s/vuesweetalert2-composition-api-1v3y7?file=/src/components/HelloWorld.vue
ps.
The images in readme are better using full path. It broken on github first page. https://raw.githubusercontent.com/avil13/vue-sweetalert2/master/packages/vue-sweetalert2/assets/logo.png https://raw.githubusercontent.com/avil13/vue-sweetalert2/master/packages/vue-sweetalert2/assets/vue-sweetalert2.gif
Ok! Please Close This Issue
@microchi Thanks for the great example for working with the Composition API.
But it seems to me that if you use it, it would be an unnecessary wrapper. You can do a direct import from
sweetalert2
library.import Swal from "sweetalert2";
That would save you the trouble of updating and transpiling.
The current implementation, is more suitable for an older version of Vue. Optional Components. You don't need to do additional imports.
I hope I managed to get my point across. If you agree, I suggest we close this issue.
You are right. I can import the sweetalert2
from the component directly. That is very helpful.
Dear @avil13
https://codesandbox.io/s/sweetalert2-vue3-jdrjc
It is a Example for calling sweetalert2 directly in Vue3 Composion API with inject.
Please use the example in readme.
Thank You~