Closed devie2020 closed 7 months ago
需要触发一下leafer-ui的resize事件,如果是在vue项目中参考下面的使用方式:
// 窗口监听
const viewport = ref<HTMLElement>() // 画布view
useResizeObserver(viewport, entries => {
const [ entry ] = entries
const { width, height } = entry.contentRect
console.log('窗口变化前', leaferUi.app.width, leaferUi.app.height)
leaferUi.app.resize({ width, height })
setTimeout(()=>{
// 重新渲染标尺
ruler.forceRender()
},0)
console.log('窗口变化后', leaferUi.app.width, leaferUi.app.height)
})