fix: hotspot, demo, i18n and type updates
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, computed, onMounted, onUnmounted } from 'vue'
|
||||
import type { Hotspot } from '@engine/types'
|
||||
import { useI18n } from '@/composables/useI18n'
|
||||
|
||||
const props = defineProps<{
|
||||
hotspots: Hotspot[]
|
||||
@@ -9,6 +10,8 @@ const props = defineProps<{
|
||||
contentSize?: { w: number; h: number } | null
|
||||
}>()
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
const emit = defineEmits<{
|
||||
clickHotspot: [hotspotId: string]
|
||||
}>()
|
||||
@@ -87,9 +90,9 @@ const hotspotRects = computed<Rect[]>(() => {
|
||||
class="hotspot-rect"
|
||||
:style="hotspotRects[i] as any"
|
||||
@click.stop="emit('clickHotspot', hs.id)"
|
||||
:title="hs.label"
|
||||
>
|
||||
<span class="hotspot-label">{{ hs.label }}</span>
|
||||
:title="t(hs.labelKey || hs.label)"
|
||||
>
|
||||
<span class="hotspot-label">{{ t(hs.labelKey || hs.label) }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -36,5 +36,14 @@
|
||||
"antiMistap": "Anti Mistap",
|
||||
"pauseEnabled": "Pause Enabled",
|
||||
"none": "None"
|
||||
},
|
||||
"scene": {
|
||||
"investigation_site": {
|
||||
"hotspot": {
|
||||
"desk": "Examine Desk",
|
||||
"window": "Check Window",
|
||||
"closet": "Inspect Closet"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -36,5 +36,14 @@
|
||||
"antiMistap": "防误触延迟",
|
||||
"pauseEnabled": "可暂停",
|
||||
"none": "无"
|
||||
},
|
||||
"scene": {
|
||||
"investigation_site": {
|
||||
"hotspot": {
|
||||
"desk": "查看书桌",
|
||||
"window": "查看窗户",
|
||||
"closet": "检查衣柜"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user