Skip to content

Commit f975b59

Browse files
chore: 更新依赖版本并修复代码中的绑定问题
1 parent f949b7e commit f975b59

File tree

4 files changed

+92
-38
lines changed

4 files changed

+92
-38
lines changed

packages/core/src/flexible.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export default class Flexible {
1616
} else {
1717
globalThis.document.addEventListener(
1818
'DOMContentLoaded',
19-
this.setBodyFontSizeMate,
19+
this.setBodyFontSizeMate.bind(this),
2020
false
2121
);
2222
}
@@ -37,7 +37,7 @@ export default class Flexible {
3737
public destroy() {
3838
globalThis.document.removeEventListener(
3939
'DOMContentLoaded',
40-
this.setBodyFontSizeMate,
40+
this.setBodyFontSizeMate.bind(this),
4141
false
4242
);
4343
globalThis.removeEventListener('resize', this.resizeHandler, false);
@@ -61,7 +61,7 @@ export default class Flexible {
6161
this.setBodyFontSize(this.dpr);
6262
}
6363
private calcFontsize() {
64-
const { width } = document.documentElement.getBoundingClientRect();
64+
const { width, } = document.documentElement.getBoundingClientRect();
6565
const dpr = 1;
6666
// const dpr = globalThis?.devicePixelRatio || 1;
6767
this.setBodyFontSize(dpr);

packages/editor/src/components/layouts/props-editor.vue

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ const curFormSchemas = ref<any>({});
5050
5151
const curStyleSwitch = ref(1);
5252
53-
const init = async(changeNode=false) => {
54-
curStyleSwitch.value = 1
53+
const init = async(changeNode = false) => {
54+
curStyleSwitch.value = 1;
5555
if (isArray(valuesFn.value)) {
5656
for (const item of valuesFn.value) {
5757
await item.reset?.();
@@ -70,57 +70,55 @@ const init = async(changeNode=false) => {
7070
ifShow: services?.propsService.getConfig('ifShow'),
7171
lifeHooks: services?.propsService.getConfig('lifeHooks'),
7272
};
73-
}
73+
}
7474
nextTick(async() => {
7575
formModel.value = {
7676
...node.value,
7777
customStyleSwitch: curStyleSwitch.value,
78-
customStyle: node.value?.style
79-
}|| {};
78+
customStyle: node.value?.style,
79+
} || {};
8080
});
8181
};
8282
8383
services?.propsService.on('props-configs-change', init);
8484
8585
watch(() => node.value, (val, oldVal) => {
86-
if (val?.field !==oldVal?.field) {
87-
curFormSchemas.value = {}
86+
if (val?.field !== oldVal?.field) {
87+
curFormSchemas.value = {};
8888
}
89-
init(val?.field !==oldVal?.field);
89+
init(val?.field !== oldVal?.field);
9090
});
9191
9292
function changeValue(value) {
9393
if (isNumber(value.customStyleSwitch)) {
9494
if (value.customStyleSwitch !== curStyleSwitch.value) {
95-
curStyleSwitch.value = value.customStyleSwitch
96-
return
95+
curStyleSwitch.value = value.customStyleSwitch;
96+
return;
9797
}
98-
Reflect.deleteProperty(value, 'customStyleSwitch')
98+
Reflect.deleteProperty(value, 'customStyleSwitch');
9999
}
100100
value.style = {
101101
...value.customStyle,
102102
...value.style,
103-
}
104-
if(value.customStyle) {
105-
Reflect.deleteProperty(value, 'customStyle')
103+
};
104+
if (value.customStyle) {
105+
Reflect.deleteProperty(value, 'customStyle');
106106
}
107107
const finValue = {
108108
...node.value,
109-
...value
110-
}
109+
...value,
110+
};
111111
if (finValue.componentProps?.events) {
112112
finValue.componentProps = {
113113
...finValue.componentProps,
114114
...finValue.componentProps.events,
115115
};
116116
}
117-
console.log('finValue',finValue, value)
118-
117+
console.log('finValue', finValue, value);
118+
119119
services?.editorService.update(finValue);
120120
}
121121
122-
123-
124122
onMounted(() => {
125123
formRef.value.length &&
126124
formRef.value.forEach((item: any) => {

pnpm-lock.yaml

Lines changed: 70 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pnpm-workspace.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ catalog:
9898
"@quantum-design/hooks": "~2.0.2-beta.0"
9999
"@quantum-design/http": "~2.0.2-beta.0"
100100
"@quantum-design/shared": "~2.0.2-beta.0"
101-
"@quantum-design/vue3-antd-pc-ui": "~2.0.2-beta.0"
101+
"@quantum-design/vue3-antd-pc-ui": "~2.0.3-beta.0"
102102
"@quantum-design/vue3-pc-ui": "~2.0.2-beta.0"
103103
"@quantum-design/types": "~2.0.2-beta.0"
104104
"@quantum-design-configs/rollup": "~2.0.2-beta.0"

0 commit comments

Comments
 (0)