Files
geekai/web/src/views/test/Test3D.vue
2025-09-03 16:00:28 +08:00

67 lines
1.4 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<div class="test-3d">
<h1>3D预览功能测试</h1>
<div class="test-container">
<h2>测试1: 默认立方体无模型URL</h2>
<div class="preview-wrapper">
<ThreeDPreview />
</div>
</div>
<div class="test-container">
<h2>测试2: 带模型URL如果有的话</h2>
<div class="preview-wrapper">
<ThreeDPreview v-if="testModelUrl" :model-url="testModelUrl" :model-type="testModelType" />
<div v-else class="no-model">
<p>没有测试模型URL</p>
</div>
</div>
</div>
</div>
</template>
<script setup>
import ThreeDPreview from '@/components/ThreeDPreview.vue'
import { ref } from 'vue'
// 测试用的模型URL可以替换为实际的模型文件
const testModelUrl = ref('https://img.r9it.com/R03TQZ7PZ386RGL7PTMNGFOHAJW15WYF.glb')
const testModelType = ref('glb')
</script>
<style lang="scss" scoped>
.test-3d {
padding: 20px;
max-width: 1200px;
margin: 0 auto;
}
.test-container {
margin-bottom: 40px;
h2 {
margin-bottom: 16px;
color: #333;
}
}
.preview-wrapper {
width: 100%;
height: 500px;
border: 2px solid #ddd;
border-radius: 8px;
overflow: hidden;
}
.no-model {
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
background: #f5f5f5;
color: #666;
}
</style>