完成适配移动端
This commit is contained in:
@@ -111,9 +111,9 @@ export function navTo(d?: any, path?: string,spm?: boolean){
|
||||
path = d?.path;
|
||||
}
|
||||
// 是否移动设备
|
||||
if(isMobileDevice()){
|
||||
path = '/m' + path;
|
||||
}
|
||||
// if(isMobileDevice()){
|
||||
// path = '/m' + path;
|
||||
// }
|
||||
// 国际化配置
|
||||
const i18n = useI18n();
|
||||
if(i18n.locale.value){
|
||||
@@ -169,3 +169,21 @@ export function loginAdminByToken(): void {
|
||||
export function getTimeStamp(): number {
|
||||
return new Date().getTime();
|
||||
}
|
||||
|
||||
// 复制文本
|
||||
export const copyText = (text: string) => {
|
||||
// 模拟 输入框
|
||||
const cInput = document.createElement('input');
|
||||
cInput.value = text;
|
||||
document.body.appendChild(cInput);
|
||||
cInput.select(); // 选取文本框内容
|
||||
|
||||
// 执行浏览器复制命令
|
||||
// 复制命令会将当前选中的内容复制到剪切板中(这里就是创建的input标签)
|
||||
// Input要在正常的编辑状态下原生复制方法才会生效
|
||||
ElMessage.success(`复制成功`);
|
||||
document.execCommand('copy');
|
||||
|
||||
// 复制成功后再将构造的标签 移除
|
||||
document.body.removeChild(cInput);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user