File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -169,11 +169,10 @@ export const flexible = (options: FlexibleOptions = {}): (() => void) => {
169169 const recalculate = ( ) => {
170170 //FIX: meta viewport 设置的 width 为 device-width 时,window.innerWidth 会比 window.visualViewport?.width 大
171171 // https://stackoverflow.com/questions/36297612/window-innerwidth-in-chromes-device-mode
172- const visualWidth = window . visualViewport ?. width ;
173- const viewportWidth = visualWidth ? visualWidth + scrollbarWidth : window . innerWidth ; // 用于断点匹配
174- // const effectiveWidth = document.documentElement.clientWidth; // 用于rem计算
175- //TODO: ?没办法去判断滚动条的状态
176- const effectiveWidth = window . innerWidth - scrollbarWidth ;
172+ /** 事实上的宽度,用于来匹配断点 */
173+ const viewportWidth = window . outerWidth ;
174+ //实际上的有效宽度
175+ const effectiveWidth = window . outerWidth - scrollbarWidth ;
177176
178177 let vw = effectiveWidth / 100 ;
179178 let matched = false ;
You can’t perform that action at this time.
0 commit comments