|
@ -6,7 +6,7 @@ |
|
|
<h1>sunfree</h1> |
|
|
<h1>sunfree</h1> |
|
|
<div class="cardText"></div> |
|
|
<div class="cardText"></div> |
|
|
<div class="button-group"> |
|
|
<div class="button-group"> |
|
|
<a-button v-for="(button, index) in buttons" :key="index" shape="circle" size="large" |
|
|
|
|
|
|
|
|
<a-button v-for="(button, index) in buttons" :key="index" shape="circle" :size="buttonSize" |
|
|
@click="handleClick(button.url)"> |
|
|
@click="handleClick(button.url)"> |
|
|
<component :is="button.icon" /> |
|
|
<component :is="button.icon" /> |
|
|
</a-button> |
|
|
</a-button> |
|
@ -26,11 +26,29 @@ |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script setup lang='ts'> |
|
|
<script setup lang='ts'> |
|
|
import { ref, onMounted } from 'vue'; |
|
|
|
|
|
|
|
|
import { ref, onMounted, computed,onUnmounted } from 'vue'; |
|
|
import iconComponents from "@/assets/index"; |
|
|
import iconComponents from "@/assets/index"; |
|
|
import { get } from '@/tools/request'; |
|
|
import { get } from '@/tools/request'; |
|
|
import type { classticInterface } from '@/api/admin'; |
|
|
import type { classticInterface } from '@/api/admin'; |
|
|
import { CaretRightOutlined } from '@ant-design/icons-vue'; |
|
|
import { CaretRightOutlined } from '@ant-design/icons-vue'; |
|
|
|
|
|
// const buttonSizesss = ref("large") |
|
|
|
|
|
const windowWidth = ref(window.innerWidth); |
|
|
|
|
|
|
|
|
|
|
|
const updateWidth = () => { |
|
|
|
|
|
windowWidth.value = window.innerWidth; |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
onMounted(() => { |
|
|
|
|
|
window.addEventListener('resize', updateWidth); |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
onUnmounted(() => { |
|
|
|
|
|
window.removeEventListener('resize', updateWidth); |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
const buttonSize = computed(() => { |
|
|
|
|
|
return windowWidth.value < 1920 ? 'small' : 'large'; |
|
|
|
|
|
}); |
|
|
const buttons = ref([ |
|
|
const buttons = ref([ |
|
|
{ icon: iconComponents.CravatarLined, url: 'https://cravatar.cn/' }, |
|
|
{ icon: iconComponents.CravatarLined, url: 'https://cravatar.cn/' }, |
|
|
{ icon: iconComponents.QQLined, url: '/qqcode' }, |
|
|
{ icon: iconComponents.QQLined, url: '/qqcode' }, |
|
|