Browse Source

REPORT-119215 fix: 统一使用clientWidth和clientHeight,父页面代理掉子应用的body的clientHeight和clientWidth到父应用的body上

research/test
jian 8 months ago
parent
commit
3ed4b251f1
  1. 8
      packages/fineui/src/base/layer/layer.popover.js
  2. 10
      packages/fineui/webpack/webpack.dev.js

8
packages/fineui/src/base/layer/layer.popover.js

@ -198,11 +198,11 @@ export class Popover extends Widget {
mounted() {
this.startX = 0;
this.startY = 0;
const bodyDom = getOuterBody();
this.tracker = new MouseMoveTracker(
(deltaX, deltaY) => {
const W = Widget._renderEngine.createElement(bodyDom).width();
const H = Widget._renderEngine.createElement(bodyDom).height();
const el = Widget._renderEngine.createElement(getOuterBody())[0];
const W = el.clientWidth;
const H = el.clientHeight;
this.startX += deltaX;
this.startY += deltaY;
this.element.css({
@ -246,7 +246,7 @@ export class Popover extends Widget {
}
_getSuitableWidth(width) {
return clamp(width, 0, Widget._renderEngine.createElement(getOuterBody()).width());
return clamp(width, 0, Widget._renderEngine.createElement(getOuterBody())[0].clientWidth);
}
_calculateSize() {

10
packages/fineui/webpack/webpack.dev.js

@ -6,7 +6,7 @@ const dirs = require("./dirs");
module.exports = merge(common, {
mode: "development",
devtool: "inline-source-map",
devtool: "eval-source-map",
output: {
path: dirs.DEST,
@ -14,14 +14,14 @@ module.exports = merge(common, {
},
devServer: {
headers: {
"Access-Control-Allow-Origin": "*",
},
port: 9001,
// liveReload: true,
client: {
logging: 'error',
overlay: {
errors: true,
warnings: false,
},
overlay: false,
},
}
});

Loading…
Cancel
Save