vue-js-grid
vue-js-grid copied to clipboard
Horizontal position error
Horizontal position does not work correctly when body's padding is not 0
This happens because euvl look for window size (tale a look at mixins)
@bitcoinmaniac An update to the documentation with be greatly appreciated rather than a fragile "take a look at x" message ;)
Incase anyone stumbles upon this and can't for their life figure out how to resize the entire container because it is for some odd reason assuming that you always use the window size rather than the container's size?
Just add this thingy thing to your Wrapper Vue Component
mounted() {
window.innerWidth = this.$el.getWidth();
window.dispatchEvent(new Event('resize'));
}
Now your grid is perfectly aligned to your vue component's wrapper, as it should be
Only downside is that we have now changed the window's innerWidth so god, knows what other issues will come from this
I got no idea why or how mixins work, but i digged into the window_size.js mixin and noticed the window.innerHeight and window.innerWidth was used, these are global variables and can be fiddled with, lucky.