docs(dom_widget_dev_guide): clarify dynamic resizing and add performance note

- Add performance note explaining that providing `getMinHeight` and `getHeight` via `options` avoids expensive DOM measurements
- Expand dynamic resizing section with detailed update sequence and common scenarios table
- Update LoraPoolSummaryView.vue with `min-height: 0` to allow flex shrinking
- Update main.ts to provide `getMinHeight` via options and adjust `computeLayoutSize` for performance
This commit is contained in:
Will Miao
2026-01-12 09:22:18 +08:00
parent 7a5f4514f3
commit 9719dd4d07
5 changed files with 53 additions and 18 deletions

View File

@@ -34,7 +34,12 @@ function createLoraPoolWidget(node) {
widget.onSetValue(v)
}
},
serialize: true
serialize: true,
// Per dev guide: providing getMinHeight via options allows the system to
// skip expensive DOM measurements during rendering loop, improving performance
getMinHeight() {
return 700
}
}
)
@@ -55,6 +60,13 @@ function createLoraPoolWidget(node) {
vueApp.mount(container)
vueApps.set(node.id, vueApp)
widget.computeLayoutSize = () => {
const minWidth = 500
const minHeight = 700
return { minHeight, minWidth }
}
widget.onRemove = () => {
const vueApp = vueApps.get(node.id)
if (vueApp) {
@@ -63,11 +75,6 @@ function createLoraPoolWidget(node) {
}
}
widget.computeLayoutSize = () => ({
minHeight: 600,
minWidth: 500
})
return { widget }
}