mirror of
https://github.com/zclzone/vue-naive-admin.git
synced 2025-04-30 22:29:01 +08:00
Compare commits
2 Commits
f482f9c741
...
10ae8ace90
Author | SHA1 | Date | |
---|---|---|---|
|
10ae8ace90 | ||
|
43506681e9 |
@ -2,13 +2,8 @@ import { permission } from '@/directives'
|
||||
/**
|
||||
* @description: 按钮权限渲染
|
||||
*/
|
||||
import { h, withDirectives } from 'vue'
|
||||
import { withDirectives } from 'vue'
|
||||
|
||||
export function PH(el, props, slots, butCode) {
|
||||
return withDirectives(
|
||||
h(el, props, slots),
|
||||
[
|
||||
[permission, butCode],
|
||||
],
|
||||
)
|
||||
export function withPermission(vnode, code) {
|
||||
return withDirectives(vnode, [[permission, code]])
|
||||
}
|
||||
|
@ -112,7 +112,7 @@
|
||||
<script setup>
|
||||
import { MeCrud, MeModal, MeQueryItem } from '@/components'
|
||||
import { useCrud } from '@/composables'
|
||||
import { formatDateTime, PH } from '@/utils'
|
||||
import { formatDateTime, withPermission } from '@/utils'
|
||||
import { NAvatar, NButton, NSwitch, NTag } from 'naive-ui'
|
||||
import api from './api'
|
||||
|
||||
@ -225,18 +225,16 @@ const columns = [
|
||||
hideInExcel: true,
|
||||
render(row) {
|
||||
return [
|
||||
PH(
|
||||
NButton,
|
||||
{
|
||||
withPermission(
|
||||
h(NButton, {
|
||||
size: 'small',
|
||||
type: 'primary',
|
||||
secondary: true,
|
||||
onClick: () => handleOpenRolesSet(row),
|
||||
},
|
||||
{
|
||||
}, {
|
||||
default: () => '超管专属',
|
||||
icon: () => h('i', { class: 'i-carbon:user-role text-14' }),
|
||||
},
|
||||
}),
|
||||
'superAdmin',
|
||||
),
|
||||
h(
|
||||
|
Loading…
x
Reference in New Issue
Block a user