-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Support Vue 3 ? #439
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
any news on this? |
It seems to me that this project is abandoned. |
Its not abandoned, just been really busy. Vue 3 is not released yet, so not a priority right now. Feel free to implement Vue 3 support and submit a PR |
Vue 3 was just released. Any progress on this end? |
I managed to run this in Vue3 environment with Vite https://github.com/SergeyKhval/vue3-grid-layout. This is not production ready, just a minimal set of changes needed to run this in Vue3. I am also not sure if it is possible to support both Vue2 and Vue3 in the same codebase. @gmsa if you open a separate branch I can make a PR |
Thanks @SergeyKhval ! Just created the vue3 branch. |
Opened a PR here #470 |
Thank you, I'll give it a look when I have some time. |
Hi @SergeyKhval , I want to test your PR, (https://github.com/SergeyKhval/vue-grid-layout/tree/vue3)
can you tell me if I'm doing well? |
@manang I mentioned in PR comment that currently build is broken because I moved from webpack to vite. I am figuring out how to restore it. For now you can run it in dev mode ( |
Ah, sorry, Thanks a lot |
@manang I downgraded |
thanks |
Hi @SergeyKhval, I got this error when I use it in vue3 |
@jok311 this is because the package currently lacks proper build step. For now you can only run it in dev mode ( |
I pushed changes to #470 which add a working build step for Vue3 with rollup. take a note that to properly use built packages in Vue3 + Vite you need to add the following export default {
optimizeDeps: {
include: ['vue-grid-layout']
}
} |
@SergeyKhval Hello, can the above scheme support VUE3 (#^.^#) |
@xiaoForest the working implementation is in this branch https://github.com/jbaysolutions/vue-grid-layout/tree/vue3. However I would not recommend to use it in production. Still feel free to test it. If you find any issues I'll try to address them |
@SergeyKhval Thanks! Build with plugins: [
vue(), // put it here
nodeResolve(),
commonjs(),
typescript({
tsconfig: false,
experimentalDecorators: true,
module: 'es2015'
}),
postcss({
plugins: [require('autoprefixer')]
}),
terser(),
] Found this solution in vuejs/rollup-plugin-vue#231 (comment) |
Is there any update on the state of the migration or when this is going to be available for production usage in the package? I'd also be willing to help push the issue if you could give me some pointers on what steps are missing/need to be worked on @SergeyKhval / @gmsa |
@plc-dev as for me it looks more or less ready, just need to add fix for build issue described aboe |
Fix plugin order as stated here: jbaysolutions#439 (comment)
Fix config as stated here: jbaysolutions#439 (comment)
@SergeyKhval Thanks for the response. I've fixed the mentioned build issues in the vue3-branch of my fork of the repository as described above. @gmsa Do you see anything still missing for an official vue-3-release? I'd also be willing to update the examples if that would help push the issue. |
I don't have any experience with Vue 3 yet, so I wouldn't know. |
@gmsa Thanks for your response. No, only the vue-grid-layout has to be built via vite and rollup. The project importing vue-grid-layout still only requires the built files in the dist-directory. I think the only thing that might be an issue is if there is more synched props in other places that have name collisions, such as the mentioned value-prop in the GridLayout component, (I only briefly checked and didn't see any), but the fix for that would be trivial. Other than that the lib is fully usable (from my testing). |
May be it'll be good if dev dependencies also get updated. At least Vite guys release like crazy and current version of Vite is far ahead from what is used here |
This doesn't apply to Vue3 projects initiated with the Vue CLI (Webpack) I guess? I still encounter the |
I could get it to work by:
|
@SergeyKhval I'm trying to run vite on the branch with "yarn dev" and I'm getting this error:
Any ideas? |
I don't understand how to run this dist with VUE 3. Pls help me =( |
I've forked this project to support Vue 3 for temporary use. https://github.com/fts1025/vue-grid-layout/tree/vue3-webpack Installnpm i -S https://github.com/fts1025/vue-grid-layout.git#vue3-webpack Import the libraryimport { GridItem, GridLayout } from 'vue-grid-layout'
export default {
components: {
GridItem,
GridLayout,
},
} or import { createApp } from 'vue';
import App from './App.vue';
import VueGridLayout from 'vue-grid-layout'
createApp(App)
.use(VueGridLayout)
.mount('#app');
} Usagerewrite prop name <grid-layout
:value="layout"
...
>
<grid-item
v-for="item in layout"
...
>
{{item.i}}
</grid-item>
</grid-layout> |
Don't help me export default { But this help for me. Thanks createApp(App) |
I did try use this |
Published a beta release for vue3 on npm Sample using it available here There are still some bugs, like responsive layouts not working, would appreciate any help, source branch is vue3-webpack |
Trying out 3.0.0.beta1 in an attempt to convert my app to VueJs 3.0. I am having the same problem as above:
returns 'undefined' for GridLayout and GridItem. While it looks like |
you can use it https://github.com/lvjunhao/vue-grid-layout |
Hi ! |
This is a package, put it in node_modules |
Is there a reason that this is not a fork? It sure would be nice to see what the changes are that were made. |
Do events not work? There are some inconsistencies with me using vue-preferences to store the layout's v-model in local storage, and was planning on using the layout updated event to save the new layout. |
Anything I can hack to get the responsive mode to work? |
But responsive mode does work. <grid-layout
v-model:layout="layout"
:col-num="10"
:col-size="20"
:is-resizable="true"
:use-css-transforms="true"
:auto-size="false"
:row-height="10"
:vertical-compact="false"
:prevent-collision="true"
:margin="margin"
@layout-updated="updateLayout"
class="content-grid"
> |
Looks like responsive mode has a bug in it (latest v3 branch):
If the layout already exists it is not saved and layout changes are lost.
I don't have the setup to test this. If anyone would be able to that be great. Update: Workaround for this bug by saving the layout on a breakpoint change eventThis uses a ref to the GridLayout instance to access the layouts object.
|
Is there any progress in moving this from beta to GA? |
tsx版本,可以用 |
Try using the module vue3-drr-grid-layout, mentioned in comment |
Is there any progress in moving this from beta to stable for Vue3 |
Hello! is there any news on the Vue3 version? Im having the same issue that brought me to this thread. The issue is: Uncaught TypeError: external_commonjs_vue_commonjs2_vue_root_Vue_default.a is not a constructor I am using Vite Thanks! |
@shariquerik @fabianB30 Have a try with vue3-drr-grid-layout ? |
@50rayn this did work! thanks for the help |
@50rayn Hello! in the code included in the vue3-drr-grid-layout docs, the script tag is written without the lang="ts", but in my proyect i must include it. But when i do, the gridItemProps all break. i get this error message: Uncaught (in promise) TypeError: Cannot destructure property 'gridItemProps' of 'undefined' as it is undefined. is there a workaround for this? Thanks |
@fabianB30 Can you please open an issue in vue3-drr-grid-layout repo and tag also the creator? I'll also try to research this issue. thanks in advance :) |
hey, I am unable to make it work with nuxt 3. I have tried both these, but I am facing issue in the server side while refresh.
|
Is it foreseen that Vue-Grid-Layout supports incoming Vue 3 ?
With latest
vue-grid-layout 2.3.7
andvue 3.0.0-beta.18
, we getThe text was updated successfully, but these errors were encountered: