mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-student.git
synced 2025-12-11 11:56:48 +08:00
edit在线课程组织显示
This commit is contained in:
23
src/hooks/useOrgName.js
Normal file
23
src/hooks/useOrgName.js
Normal file
@@ -0,0 +1,23 @@
|
||||
/**截取机构名称路径namePath最后两段,不包含第一个 */
|
||||
const useOrgName = (namePath) => {
|
||||
let newName = namePath;
|
||||
if (newName) {
|
||||
let names = newName.split(',');
|
||||
let len = names.length;
|
||||
//使用最后两们
|
||||
if (len > 1) {
|
||||
newName = names[1];
|
||||
if (!newName) {
|
||||
newName = names[0]
|
||||
}
|
||||
}
|
||||
}
|
||||
return newName;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
export {
|
||||
useOrgName
|
||||
}
|
||||
Reference in New Issue
Block a user