1- <!--
2- * @Author: weisheng
3- * @Date: 2024-02-02 15:40:08
4- * @LastEditTime: 2024-02-03 23:56:17
5- * @LastEditors: weisheng
6- * @Description:
7- * @FilePath: \wot-design-uni\docs\.vitepress\theme\components\HomeFriendly.vue
8- * 记得注释
9- -->
10- <style scoped></style >
11-
121<script setup lang="ts">
132import { computed } from ' vue'
143import { useFriendly } from ' ../composables/friendly'
@@ -17,8 +6,8 @@ import VPFeature from 'vitepress/dist/client/theme-default/components/VPFeature.
176const { data } = useFriendly ()
187
198
20- const features = computed (() => {
21- return data && data .value ? data .value : [{
9+ const links = computed (() => {
10+ return data .value . length ? data .value : [{
2211 icon: " https://www.flowerui.com/logo.png" ,
2312 title: ' Flower Library' ,
2413 details: ' uni-app 多平台多版本兼容的轻量、简洁、高效、全面的移动端组件库' ,
@@ -32,7 +21,7 @@ const features = computed(() => {
3221})
3322
3423const grid = computed (() => {
35- const length = features .value .length || 0
24+ const length = links .value .length || 0
3625 if (! length ) {
3726 return
3827 } else {
@@ -42,12 +31,12 @@ const grid = computed(() => {
4231 </script >
4332
4433<template >
45- <div v-if =" features && features .length" class =" VPFeatures" >
34+ <div v-if =" links && links .length" class =" VPFeatures" >
4635 <div class =" container" >
4736 <h1 class =" friendly-title" >友情链接</h1 >
4837
4938 <div class =" items" >
50- <div v-for =" feature in features " :key =" feature.title" class =" item" :class =" [grid]" >
39+ <div v-for =" feature in links " :key =" feature.title" class =" item" :class =" [grid]" >
5140 <VPFeature :icon =" { src: feature.icon, height: '48px', width: 'auto' }" :title =" feature.title"
5241 :details =" feature.details" :link =" feature.link" />
5342 </div >
0 commit comments