Skip to content

Commit

Permalink
feat: 全局挂载Reflect反射对象
Browse files Browse the repository at this point in the history
  • Loading branch information
buqiyuan committed Dec 15, 2021
1 parent f7aceff commit e5ba20a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/dynamic-table/dynamic-table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
@change="handleTableChange"
>
<template
v-for="slotName in defaultSlots.filter((name) => Object.hasOwnProperty($slots, name))"
v-for="slotName in defaultSlots.filter((name) => Reflect.has($slots, name))"
#[slotName]="slotData"
:key="slotName"
>
Expand Down
3 changes: 3 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ import permission from '@/core/permission/';

const app = createApp(App);

// 全局挂载Reflect反射对象
app.config.globalProperties.Reflect = Reflect;

app.use(permission);

// app.use(useFormModal)
Expand Down
1 change: 1 addition & 0 deletions types/shims/shims-vue.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ declare module '*.vue' {
declare module '@vue/runtime-core' {
export interface ComponentCustomProperties {
$auth: (perm: PermissionType) => boolean;
Reflect: Reflect;
}
}

Expand Down

0 comments on commit e5ba20a

Please sign in to comment.