当前位置: 首页 > news >正文

网站规划文字说明郑州网络公司排名

网站规划文字说明,郑州网络公司排名,事件营销怎么做,中国邮政做特产得网站实现5*5正方形网格x轴和y轴显示对应数值组件封装 需求&#xff1a;按5*5的正方形网格&#xff0c;根据目标数据的x和y轴值显示对应的文字&#xff0c;实现效果图如下&#xff1a;&#xff08;当前目标数值&#xff1a;x2&#xff0c;y2&#xff09; 代码如下&#xff1a; <…

实现5*5正方形网格x轴和y轴显示对应数值组件封装

需求:按5*5的正方形网格,根据目标数据的x和y轴值显示对应的文字,实现效果图如下:(当前目标数值:x=2,y=2)

在这里插入图片描述

代码如下:

<template><div class="box"><div class="box-item" v-for="(item, index) in itemList" :key="index" :class="item.className">{{ (x === item.x && y === item.y) ? item.label : '' }}</div></div>
</template><script setup lang="ts">
withDefaults(defineProps<{x?: number,y?: number
}>(), {x: 2,y: 2
})interface itemType {className: string;label: string;x: number;y: number;
}
let itemList: itemType[] = Array.from({ length: 25 }).map((_, index) => {let result = {className: '',label: '中',x: 0,y: 0}if ([3, 4, 8, 9, 14].includes(index)) {result.className = 'blue'result.label = '高'} else if ([10, 15, 16, 20, 21].includes(index)) {result.className = 'orange'result.label = '低'}result.className += ` xy-${index}`return result
})
let Y = 10
for (let j = 0; j < 25; j += 5) {for (let i = j; i < j + 5; i++) {if ([0, 5, 10, 15, 20].includes(i)) {itemList[i].x = 2} else {itemList[i].x = itemList[i - 1].x + 2}itemList[i].y = Y}Y -= 2
}
</script><style lang="scss" scoped>
.box {width: 270px;display: flex;flex-wrap: wrap;position: absolute;&::after {content: 'x轴';position: absolute;bottom: -20px;right: -10px;}&::before {content: 'y轴';position: absolute;top: -10px;left: -20px;// transform: rotate(-90deg);writing-mode:vertical-lr;}
}.box-item {width: 20%;height: 50px;border: 1px solid #ff0000;box-sizing: border-box;font-size: 16px;display: flex;align-items: center;justify-content: center;position: relative;&.xy-0::after {content: '10';position: absolute;left: -20px;}&.xy-5::after {content: '8';position: absolute;left: -20px;}&.xy-10::after {content: '6';position: absolute;left: -20px;}&.xy-15::after {content: '4';position: absolute;left: -20px;}&.xy-20::after {content: '2';position: absolute;left: -20px;}&.xy-20::before {content: '2';position: absolute;bottom: -20px;}&.xy-21::before {content: '4';position: absolute;bottom: -20px;}&.xy-22::before {content: '6';position: absolute;bottom: -20px;}&.xy-23::before {content: '8';position: absolute;bottom: -20px;}&.xy-24::before {content: '10';position: absolute;bottom: -20px;}
}.blue {background-color: skyblue;
}.orange {background-color: orange;
}
</style>
http://www.khdw.cn/news/23590.html

相关文章:

  • 网站后台内容编辑器免费域名注册网站
  • 私人兼职做网站开发专门发广告的app
  • 微信 网站建设企点官网
  • 菜鸟建站网免费二级域名分发
  • 长沙3合1网站建设专业的网络推广
  • 青岛h5建站模板哪里有seo排名优化
  • 做百科需要发哪些网站百度检索入口
  • 网站建设人员职责互联网营销师证书含金量
  • 网页设计简单基础页面模板百度seo公司一路火
  • 企业网站wap源码学做网站培训班要多少钱
  • 创业做网站需要哪些seo优化分析
  • wordpress bae版知名的seo快速排名多少钱
  • 怎么做快法务类似网站郑州seo优化阿亮
  • 做一视频网站网站优化公司收费
  • 龙岩网站设计理念百度竞价专员
  • 网站设计与制作一般步骤seo外包杭州
  • 中国十大电商排行榜泉州关键词优化软件
  • net创建网站之后怎么做百度授权代理商
  • 沈阳模板建站方案网店代运营和推广销售
  • 绵阳网站设计公司网站怎么优化排名靠前
  • 宁波市北仑区建设局网站营销型企业网站建设的内容
  • 网站建设制作软件网络推广都有哪些方式
  • 北京专业网站建设公司排名传智播客培训机构官网
  • 惠州关键词排名推广青岛网站建设方案优化
  • 深圳建设网站培训机构郑州网站优化排名
  • 网站建设小程序微博营销的特点
  • 销售crm南通百度seo代理
  • 网站四对联广告代码百度权重划分等级
  • 住房和城乡建设部是国家认定网站吗培训机构招生方案范文
  • 如何制作自己的网站图?网络推广方法大全