refactor(ui): 统一使用useMounted钩子简化页面初始化逻辑

This commit is contained in:
xiaojunnuo
2026-06-06 00:50:59 +08:00
parent 5546af518e
commit 1175e1164b
29 changed files with 118 additions and 202 deletions
@@ -104,15 +104,7 @@ export default defineComponent({
// 更多关于按钮权限的源代码设置,请参考 ./src/plugin/fast-crud/index.js 75-77行)
const { crudBinding, crudRef, crudExpose } = useFs({ createCrudOptions, context: { authz, permission } });
// 页面打开后获取列表数据
onMounted(() => {
// crudExpose.doRefresh();
});
onActivated(async () => {
await crudExpose.doRefresh();
});
useMounted(() => crudExpose.doRefresh());
return {
crudBinding,
crudRef,
@@ -18,14 +18,7 @@ export default defineComponent({
// 此处传入权限前缀进行通用按钮权限设置,会通过commonOptions去设置actionbar和rowHandle的按钮的show属性
// 更多关于按钮权限的源代码设置,请参考 ./src/plugin/fast-crud/index.js 75-77行)
const { crudBinding, crudRef, crudExpose } = useFs({ createCrudOptions, context: { permission: "sys:auth:user" } });
// 页面打开后获取列表数据
onMounted(() => {
// crudExpose.doRefresh();
});
onActivated(async () => {
await crudExpose.doRefresh();
});
useMounted(() => crudExpose.doRefresh());
return {
crudBinding,