接口
This commit is contained in:
@@ -1,18 +1,22 @@
|
||||
<template>
|
||||
<el-select v-model="roleId" filterable @change="handleChangeRole" style="width: 150px">
|
||||
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
|
||||
<el-option v-for="item in options" :key="item.id" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
</template>
|
||||
|
||||
<script setup name="RoleSelect">
|
||||
const options = ref([
|
||||
{ value: 1, label: '超级管理员' },
|
||||
{ value: 2, label: '销售' }
|
||||
])
|
||||
import { useUserStore } from '@/store/modules/user'
|
||||
import { getInfo } from '@/api/login/index'
|
||||
|
||||
const userStore = useUserStore()
|
||||
|
||||
const options = computed(() => {
|
||||
return userStore.getRoles
|
||||
})
|
||||
const roleId = ref(1)
|
||||
|
||||
function handleChangeRole() {
|
||||
console.log('修改角色')
|
||||
function handleChangeRole(val) {
|
||||
getInfo({ params: { roleId: val } })
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user