1.0.2 • Published 2 years ago

@misterzhang/vite-plugin-auth v1.0.2

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

vite-plugin-auth

介绍

安装

    npm install @misterzhang/vite-plugin-auth --save-dev
    npm install @misterzhang/vue-auth-directive

配置 vite.config.ts

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'

import authPlugin from '@misterzhang/vite-plugin-auth'

// https://vitejs.dev/config/
export default defineConfig({
    plugins: [authPlugin(),vue()]
})

使用 App.vue

    <template>
         <img  v-auth:role ="['ownerCargo','platform']"   />
         <img  v-auth:role ="'ownerCargo'"   />
         <img  v-auth:perm ="['ownerCargo','platform']"   />
         <img  v-auth:perm ="'ownerCargo'"   />
    </template>