|
|
@ -4,18 +4,18 @@ import { computed, ref } from 'vue' |
|
|
|
|
|
|
|
const deviceStore = useDeviceStore() |
|
|
|
const deviceInfo = ref(deviceStore.deviceInfo) |
|
|
|
const screenInfo = { |
|
|
|
width: window.innerWidth, // 屏幕宽度(逻辑像素) |
|
|
|
height: window.innerHeight, // 屏幕高度(逻辑像素) |
|
|
|
availWidth: window.screen.availWidth, // 可用宽度(排除任务栏等) |
|
|
|
availHeight: window.screen.availHeight, // 可用高度 |
|
|
|
pixelRatio: window.devicePixelRatio, // 设备像素比(物理像素/逻辑像素) |
|
|
|
colorDepth: window.screen.colorDepth, // 颜色深度 |
|
|
|
} |
|
|
|
const width = Math.floor(screenInfo.width * screenInfo.pixelRatio) |
|
|
|
const height = Math.floor(screenInfo.height * screenInfo.pixelRatio) |
|
|
|
const screenWidth = ref(width) |
|
|
|
const screenHeight = ref(height) |
|
|
|
// const screenInfo = { |
|
|
|
// width: window.innerWidth, // 屏幕宽度(逻辑像素) |
|
|
|
// height: window.innerHeight, // 屏幕高度(逻辑像素) |
|
|
|
// availWidth: window.screen.availWidth, // 可用宽度(排除任务栏等) |
|
|
|
// availHeight: window.screen.availHeight, // 可用高度 |
|
|
|
// pixelRatio: window.devicePixelRatio, // 设备像素比(物理像素/逻辑像素) |
|
|
|
// colorDepth: window.screen.colorDepth, // 颜色深度 |
|
|
|
// } |
|
|
|
// const width = Math.floor(screenInfo.width * screenInfo.pixelRatio) |
|
|
|
// const height = Math.floor(screenInfo.height * screenInfo.pixelRatio) |
|
|
|
// const screenWidth = ref(width) |
|
|
|
// const screenHeight = ref(height) |
|
|
|
|
|
|
|
const webVersion = computed(() => __APP_VERSION__) |
|
|
|
</script> |
|
|
@ -34,9 +34,9 @@ const webVersion = computed(() => __APP_VERSION__) |
|
|
|
<div class="device-ul"> |
|
|
|
<div>初始化状态:{{ deviceInfo.deviceTypeInited ? '已初始化' : '未初始化' }}</div> |
|
|
|
</div> |
|
|
|
<div class="device-ul"> |
|
|
|
<div>设备屏幕尺寸:{{ screenWidth }} x {{ screenHeight }}</div> |
|
|
|
</div> |
|
|
|
<!-- <div class="device-ul"> --> |
|
|
|
<!-- <div>设备屏幕尺寸:{{ screenWidth }} x {{ screenHeight }}</div> --> |
|
|
|
<!-- </div> --> |
|
|
|
<div class="device-ul"> |
|
|
|
<div>版本信息:{{ `${deviceInfo.appVersion}-${webVersion}` }}</div> |
|
|
|
</div> |
|
|
|