yanzhen-design-vue
Version:
23 lines (22 loc) • 596 B
JavaScript
import { unref } from "@yanzhen-libs/utils-vue";
import { isEmptyValue } from "@yanzhen-libs/utils";
import "../constants/index.mjs";
import { Contacts } from "../constants/contacts.mjs";
function handleActiveTabKey({ activeTab, userActiveTab }, defaultKey) {
const _activeTab = unref(activeTab);
let key;
switch (true) {
case _activeTab === Contacts.USER:
key = `${_activeTab}-${unref(userActiveTab)}`;
break;
case !isEmptyValue(_activeTab):
key = _activeTab;
break;
default:
key = defaultKey;
}
return key;
}
export {
handleActiveTabKey
};