mirror of
https://github.com/certd/certd.git
synced 2026-07-20 05:37:32 +08:00
refactor(ui): 统一使用useMounted钩子简化页面初始化逻辑
This commit is contained in:
@@ -46,11 +46,15 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { useMounted } from "/@/use/use-mounted";
|
||||
import { computed, onActivated, onMounted } from "vue";
|
||||
import { useMounted } from "/@/use/use-mounted";
|
||||
import { Modal, notification } from "ant-design-vue";
|
||||
import { useMounted } from "/@/use/use-mounted";
|
||||
import { useFs } from "@fast-crud/fast-crud";
|
||||
import createCrudOptions from "./crud-level";
|
||||
import * as api from "./api";
|
||||
import { useMounted } from "/@/use/use-mounted";
|
||||
import { util } from "/@/utils";
|
||||
|
||||
defineOptions({ name: "SysInviteLevel" });
|
||||
@@ -92,13 +96,7 @@ function confirmRemove(opts: any) {
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
// crudExpose.doRefresh();
|
||||
});
|
||||
onActivated(() => {
|
||||
crudExpose.doRefresh();
|
||||
});
|
||||
useMounted(() => crudExpose.doRefresh());
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
|
||||
@@ -8,18 +8,14 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { useMounted } from "/@/use/use-mounted";
|
||||
import { onActivated, onMounted } from "vue";
|
||||
import { useMounted } from "/@/use/use-mounted";
|
||||
import { useFs } from "@fast-crud/fast-crud";
|
||||
import createCrudOptions from "./crud-user-level";
|
||||
|
||||
defineOptions({ name: "SysInviteUserLevel" });
|
||||
|
||||
const { crudBinding, crudRef, crudExpose } = useFs({ createCrudOptions });
|
||||
|
||||
onMounted(() => {
|
||||
// crudExpose.doRefresh();
|
||||
});
|
||||
onActivated(() => {
|
||||
crudExpose.doRefresh();
|
||||
});
|
||||
useMounted(() => crudExpose.doRefresh());
|
||||
</script>
|
||||
|
||||
@@ -8,18 +8,14 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { useMounted } from "/@/use/use-mounted";
|
||||
import { onActivated, onMounted } from "vue";
|
||||
import { useMounted } from "/@/use/use-mounted";
|
||||
import { useFs } from "@fast-crud/fast-crud";
|
||||
import createCrudOptions from "./crud-withdraw";
|
||||
|
||||
defineOptions({ name: "SysInviteWithdraw" });
|
||||
|
||||
const { crudBinding, crudRef, crudExpose } = useFs({ createCrudOptions });
|
||||
|
||||
onMounted(() => {
|
||||
// crudExpose.doRefresh();
|
||||
});
|
||||
onActivated(() => {
|
||||
crudExpose.doRefresh();
|
||||
});
|
||||
useMounted(() => crudExpose.doRefresh());
|
||||
</script>
|
||||
|
||||
@@ -11,21 +11,15 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { onActivated, onMounted } from "vue";
|
||||
import { useFs } from "@fast-crud/fast-crud";
|
||||
import createCrudOptions from "./crud";
|
||||
import { useMounted } from "/@/use/use-mounted";
|
||||
|
||||
defineOptions({
|
||||
name: "OrderManager",
|
||||
});
|
||||
const { crudBinding, crudRef, crudExpose } = useFs({ createCrudOptions });
|
||||
|
||||
// 页面打开后获取列表数据
|
||||
onMounted(() => {
|
||||
// crudExpose.doRefresh();
|
||||
});
|
||||
onActivated(() => {
|
||||
crudExpose.doRefresh();
|
||||
});
|
||||
useMounted(() => crudExpose.doRefresh());
|
||||
</script>
|
||||
<style lang="less"></style>
|
||||
|
||||
@@ -11,7 +11,9 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { useMounted } from "/@/use/use-mounted";
|
||||
import { onActivated, onMounted } from "vue";
|
||||
import { useMounted } from "/@/use/use-mounted";
|
||||
import { useFs } from "@fast-crud/fast-crud";
|
||||
import createCrudOptions from "./crud";
|
||||
|
||||
@@ -19,12 +21,5 @@ defineOptions({
|
||||
name: "UserSuites",
|
||||
});
|
||||
const { crudBinding, crudRef, crudExpose } = useFs({ createCrudOptions, context: {} });
|
||||
|
||||
// 页面打开后获取列表数据
|
||||
onMounted(() => {
|
||||
// crudExpose.doRefresh();
|
||||
});
|
||||
onActivated(() => {
|
||||
crudExpose.doRefresh();
|
||||
});
|
||||
useMounted(() => crudExpose.doRefresh());
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user