解决权限无法显示问题

This commit is contained in:
mkppo 2021-12-08 11:38:13 +08:00
parent 43b3956640
commit 509719a643

View File

@ -13,7 +13,8 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import { defineComponent, inject, ref, watch } from "vue"; import { defineComponent, ref, watch } from "vue";
import { useCool } from "/@/cool";
export default defineComponent({ export default defineComponent({
name: "cl-menu-perms", name: "cl-menu-perms",
@ -28,7 +29,7 @@ export default defineComponent({
emits: ["update:modelValue"], emits: ["update:modelValue"],
setup(props, { emit }) { setup(props, { emit }) {
const service = inject<any>("service"); const { service } = useCool();
// //
const value = ref<any[]>([]); const value = ref<any[]>([]);
@ -67,6 +68,7 @@ export default defineComponent({
const col = (i: number, d: any[]) => { const col = (i: number, d: any[]) => {
const key = arr[i]; const key = arr[i];
if (d) {
const index = d.findIndex((e: any) => e.label == key); const index = d.findIndex((e: any) => e.label == key);
if (index >= 0) { if (index >= 0) {
@ -84,6 +86,7 @@ export default defineComponent({
col(i + 1, d[d.length - 1].children || []); col(i + 1, d[d.length - 1].children || []);
} }
} }
}
}; };
col(0, list); col(0, list);