You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a great library! Really smart architecture.
With mixed lists & complex UIs, it's not always the easiest thing to just spell out the heights of the items individually (mixing in group headers, etc). Fortunately, your basic structure doesn't require that! What works better for me, is to set an explicit style on each item that announces the height (i.e. <h1 style="height: 30px">Some Header</h1>), and then rewire the getVarSize thusly:
// return a variable size (height) from given index.
getVarSize: function (index, nocache) {
var cache = this.delta.varCache[index]
const get = (index) => {
var item = this.$slots.default[index];
if(item.data.staticStyle && item.data.staticStyle.height) {
var m = item.data.staticStyle.height.match(/^(.*)px$/);
return Number(m[1]);
}
return Number(item.data.attrs.height);
}
return (!nocache && cache && cache.size) || get(index) || 0
},
If I were to push this as a PR, I'd make it so it does this if variable is set to true, and retain the original behavior if it's a function. Thoughts?
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
This is a great library! Really smart architecture.
With mixed lists & complex UIs, it's not always the easiest thing to just spell out the heights of the items individually (mixing in group headers, etc). Fortunately, your basic structure doesn't require that! What works better for me, is to set an explicit style on each item that announces the height (i.e.
<h1 style="height: 30px">Some Header</h1>
), and then rewire the getVarSize thusly:If I were to push this as a PR, I'd make it so it does this if
variable
is set totrue
, and retain the original behavior if it's a function. Thoughts?The text was updated successfully, but these errors were encountered: