Skip to content

Commit

Permalink
fix: when the form is destroyed, the form parameters still exist (vbe…
Browse files Browse the repository at this point in the history
…njs#4834)

* fix: when the form is destroyed, the form parameters still exist

* chore: update deps
  • Loading branch information
anncwb authored Nov 7, 2024
1 parent dcdebaf commit 8f1e397
Show file tree
Hide file tree
Showing 9 changed files with 159 additions and 154 deletions.
2 changes: 0 additions & 2 deletions docs/src/components/common-ui/vben-vxe-table.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,6 @@ useVbenVxeGrid 返回的第二个参数,是一个对象,包含了一些表
| grid | vxe-table grid实例 | `VxeGridInstance` |
| formApi | vbenForm api实例 | `FormApi` |

### Props

## Props

所有属性都可以传入 `useVbenVxeGrid` 的第一个参数中。
Expand Down
2 changes: 1 addition & 1 deletion docs/src/en/guide/essentials/styles.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ const { b, e, is } = useNamespace('menu');
</template>
<style lang="scss" scoped>
// If you use it within the application, this line of code can be omitted as it has already been globally introduced in all applications
@import '@vben/styles/global';
@use '@vben/styles/global' as *;
@include b('menu') {
color: black;
Expand Down
2 changes: 1 addition & 1 deletion docs/src/guide/essentials/styles.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ const { b, e, is } = useNamespace('menu');
</template>
<style lang="scss" scoped>
// 如果你在应用内使用,这行代码可以省略,已经在所有的应用内全局引入了
@import '@vben/styles/global';
@use '@vben/styles/global' as *;
@include b('menu') {
color: black;
Expand Down
2 changes: 1 addition & 1 deletion internal/vite-config/src/config/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ function createCssOptions(injectGlobalScss = true) {
const relativePath = relative(root, filepath);
// apps下的包注入全局样式
if (relativePath.startsWith(`apps${path.sep}`)) {
return `@import "@vben/styles/global";\n${content}`;
return `@use "@vben/styles/global" as *;\n${content}`;
}
return content;
},
Expand Down
1 change: 1 addition & 0 deletions packages/@core/ui-kit/form-ui/src/form-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ export class FormApi {
}

unmount() {
this.form?.resetForm?.();
// this.state = null;
this.isMounted = false;
this.stateHandler.reset();
Expand Down
6 changes: 6 additions & 0 deletions packages/effects/plugins/src/vxe-table/use-vxe-grid.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
computed,
nextTick,
onMounted,
onUnmounted,
toRaw,
useSlots,
useTemplateRef,
Expand Down Expand Up @@ -256,6 +257,11 @@ onMounted(() => {
props.api?.mount?.(gridRef.value, formApi);
init();
});
onUnmounted(() => {
formApi?.unmount?.();
props.api?.unmount?.();
});
</script>

<template>
Expand Down
2 changes: 1 addition & 1 deletion packages/styles/src/global/index.scss
Original file line number Diff line number Diff line change
@@ -1 +1 @@
@import '@vben-core/design/bem';
@use '@vben-core/design/bem' as *;
Loading

0 comments on commit 8f1e397

Please sign in to comment.