tiny-vue/examples/sites/demos/pc/app/drop-roles/change-role-event.vue

32 lines
722 B
Vue
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<tiny-drop-roles v-model="value" @change="change"></tiny-drop-roles>
</template>
<script lang="jsx">
import { DropRoles, Notify } from '@opentiny/vue'
export default {
components: {
TinyDropRoles: DropRoles
},
data() {
return {
value: ''
}
},
methods: {
change(role) {
// 下拉角色组件需要触发 change 事件去发送请求role 为要切换的角色
this.$service.common.getChangeRoleUrl(role).then((url) => {
// window.location.href = url
Notify({
title: '切换后的角色是:' + role + ',根据角色发送请求的 URL 如下:',
message: url,
offset: 0
})
})
}
}
}
</script>