35 lines
466 B
Vue
35 lines
466 B
Vue
<template>
|
|
<view v-if='!hasPermi(code)'>
|
|
<slot></slot>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
import auth from '@/plugins/auth.js'
|
|
export default {
|
|
name: "has-authority",
|
|
props: {
|
|
code: {
|
|
type: String,
|
|
required: true,
|
|
default: ''
|
|
},
|
|
},
|
|
data() {
|
|
return {};
|
|
},
|
|
methods: {
|
|
hasPermi(code) {
|
|
if (typeof code === 'string') {
|
|
return auth.hasPermi(code)
|
|
} else {
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style>
|
|
|
|
</style> |