mirror of
https://github.com/pure-admin/vue-pure-admin.git
synced 2025-06-06 00:18:51 +08:00
21 lines
413 B
TypeScript
21 lines
413 B
TypeScript
import { defineComponent, Fragment } from "vue";
|
|
import { hasAuth } from "@/router/utils";
|
|
|
|
export default defineComponent({
|
|
name: "Auth",
|
|
props: {
|
|
value: {
|
|
type: undefined,
|
|
default: []
|
|
}
|
|
},
|
|
setup(props, { slots }) {
|
|
return () => {
|
|
if (!slots) return null;
|
|
return hasAuth(props.value) ? (
|
|
<Fragment>{slots.default?.()}</Fragment>
|
|
) : null;
|
|
};
|
|
}
|
|
});
|