This commit is contained in:
18
src/App.vue
18
src/App.vue
@ -1,19 +1,13 @@
|
||||
<template>
|
||||
|
||||
<HelloWorld />
|
||||
</template>
|
||||
|
||||
|
||||
<script setup lang="ts">
|
||||
import HelloWorld from './components/HelloWorld.vue'
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<a href="https://vite.dev" target="_blank">
|
||||
<img src="/vite.svg" class="logo" alt="Vite logo" />
|
||||
</a>
|
||||
<a href="https://vuejs.org/" target="_blank">
|
||||
<img src="./assets/vue.svg" class="logo vue" alt="Vue logo" />
|
||||
</a>
|
||||
</div>
|
||||
sfgdfgdfhfgh
|
||||
<HelloWorld msg="Vite + 高峰过后结双方的果很快ui哦山豆根豆腐干里噢批哦就将很快" />
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.logo {
|
||||
|
@ -1,17 +1,27 @@
|
||||
|
||||
<template>
|
||||
|
||||
<div>
|
||||
<img :src="url" alt=""/>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref } from 'vue';
|
||||
|
||||
let url=ref('')
|
||||
|
||||
onMounted(()=>{
|
||||
const publicPath = import.meta.env.VITE_PUBLIC;
|
||||
console.log('环境变量 VITE_PUBLIC:', publicPath);
|
||||
console.log('所有环境变量:', import.meta);
|
||||
|
||||
url.value = publicPath + 'ui/背景.png'
|
||||
console.log('最终图片路径:', url.value);
|
||||
})
|
||||
|
||||
|
||||
const bg = import.meta.env.VITE_BG
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
<style scoped>
|
||||
.read-the-docs {
|
||||
color: #888;
|
||||
}
|
||||
</style>
|
||||
<style scoped></style>
|
||||
|
Reference in New Issue
Block a user