mirror of
https://github.com/certd/certd.git
synced 2026-07-16 18:57:32 +08:00
refactor(ui): 统一使用useMounted钩子简化页面初始化逻辑
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user