Skip to content
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

initial responsive version #194

Closed
wants to merge 2 commits into from
Closed

Conversation

shpfive
Copy link
Contributor

@shpfive shpfive commented Jun 27, 2018

my try for including responsive features.
please look into it and give feedback

@gmsa gmsa mentioned this pull request Jul 2, 2018
@gmsa
Copy link
Contributor

gmsa commented Jul 19, 2018

Sorry but this doesn't work. If you run this with yarn dev or npm run dev it throws the following error:

ERROR in ./node_modules/vue-loader/lib/template-compiler?{"id":"data-v-e025cafc"}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/ResponsiveGridLayout.vue
(Emitted value instead of an instance of Error) 
  Error compiling template:
  
  <div ref="item" class="vue-grid-layout" :style="mergedStyle">
      <template v-for="item in actLayout" :key="item.i">
          <slot :item="item"></slot>
      </template>
      <grid-item class="vue-grid-placeholder"
                 v-show="isDragging"
                 :x="placeholder.x"
                 :y="placeholder.y"
                 :w="placeholder.w"
                 :h="placeholder.h"
                 :i="placeholder.i"></grid-item>
  </div>
  
  - <template> cannot be keyed. Place the key on real elements instead.

There is no sample for the responsive layout or instructions on how to use it.

@shpfive
Copy link
Contributor Author

shpfive commented Aug 23, 2018

i did a quick fix. that was an easy one. should be working now.
you dont have to do anything the sample is the app.vue

its still not perfect but i think you'll get an idea

@alc32
Copy link

alc32 commented Sep 28, 2018

Is this working?

@shpfive
Copy link
Contributor Author

shpfive commented Sep 28, 2018

@alc32 mostly ? i think it can be improve but it works.
https://strml.github.io/react-grid-layout/examples/0-showcase.html its just like in this example so evrything gets stacked on left or right side

@eugenesaenko
Copy link

Why this haven't merged yet?

@lmlong-huynh
Copy link

Will this pr be merged anytime soon in the nearest future?

@gmsa
Copy link
Contributor

gmsa commented Oct 3, 2018

It wasn't working when I first tried it, I didn't check it after the fix. I hope to have some free time to work on it during the next few weeks.

@bensladden
Copy link

i have noticed one bug if you add an item on one layout it will not appear on layouts you have already been on.

  1. Start on lg layout
  2. Move to md layout
  3. Add item
  4. Move to lg layout and the item will not be there

@lmlong-huynh
Copy link

Any update on this?

@shpfive
Copy link
Contributor Author

shpfive commented Oct 15, 2018

had no time to look into the bug @bensladden mentioned. will try as soon as possible

@lmlong-huynh
Copy link

had no time to look into the bug @bensladden mentioned. will try as soon as possible

I added a comment where the bug is with a fix please have a review. The rest seems to work fine.

@shpfive
Copy link
Contributor Author

shpfive commented Oct 16, 2018

@MLongz i'm sorry but where did you comment ?

@lmlong-huynh
Copy link

lmlong-huynh commented Oct 16, 2018

@shpfive

It's seems the comment is pending. Its in new_responsiveutils.js at line 97. This seems to fix the bug where gridItem didnt got copied over to the other breakpoints.

for (let i = 0, len = breakpointsAbove.length; i < len; i++) {
        const b = breakpointsAbove[i];
        if (layouts[b]) {
            layout = layouts[b];
            if (layouts[b].length !== actLayout.length) {
                let newItem = actLayout[actLayout.length - 1];
                layout.push(newItem)
            }
            break;
        }
    } 

But probably have to add a function to Check latest valid item and not last of array. Since you can remove items from array.

@shpfive
Copy link
Contributor Author

shpfive commented Oct 18, 2018

@MLongz thank you for your help. i fixed it differently but i think it should work
#228 please have a look into it as i updated to new plugin structure

@shpfive shpfive closed this Oct 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants