We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
As the picture above shows, the height of the element bigger, the vertical gap of the element bigger. Core code is below:
waterfall( :line-gap="260", :watch="list", ) waterfall-slot( v-for="(card, index) in list", :key="card.user.uid", :width="waterfallWidth", :height="waterfallHeight", :order="index" ) canvas-card
I have saw the source code of vue-waterfall. I think the code of calculating position is below, but can't understand some code.
function reflow () { if (!this.$el) { return } let width = this.$el.clientWidth let metas = this.$children.map((slot) => slot.getMeta()) metas.sort((a, b) => a.order - b.order) console.log('reflow-metas', metas) this.virtualRects = metas.map(() => ({})) // can't understand console.log('virtualRects', this.virtualRects) calculate(this, metas, this.virtualRects) setTimeout(() => { if (isScrollBarVisibilityChange(this.$el, width)) { calculate(this, metas, this.virtualRects) } this.style.overflow = 'hidden' render(this.virtualRects, metas) this.$emit('reflowed', this) }, 0) }
I print some data on the console, I don't konw why the this.virtualRects is shown as below:
this.virtualRects
Could you give me some advice?
The text was updated successfully, but these errors were encountered:
@ihaichao you should focus on where to use this.virtualRects. this.virtualRects is a variable to store all of waterfall-slot's rect info.
waterfall-slot
Where you can't understand this.virtualRects = metas.map(() => ({})) is just for initializing this.virtualRects
this.virtualRects = metas.map(() => ({}))
Sorry, something went wrong.
No branches or pull requests
As the picture above shows, the height of the element bigger, the vertical gap of the element bigger.
Core code is below:
I have saw the source code of vue-waterfall. I think the code of calculating position is below, but can't understand some code.
I print some data on the console, I don't konw why the
this.virtualRects
is shown as below:Could you give me some advice?
The text was updated successfully, but these errors were encountered: