首页 > 其他分享 >vue遍历数据

vue遍历数据

时间:2023-02-26 00:33:21浏览次数:34  
标签:遍历 margin top height vue radius font 数据 left

vue代码

<template>
  <div class="index">
    <!-- 遍历 -->
    <div v-for="(item, index) in catalogue" :key="index">
      <!-- 页面跳转 -->
      <!-- <router-link :to="{path:'/book',query:{levels:item.levels}}"> -->
      <div class="boxtop" style="background-color: #ffffff;">
        <div class="boxright">{{item.catalogueName}}</div>
        <div class="box" style="background-color: #ffffff;">
          <div class="boxtext">{{index}}</div>
        </div>
      </div>
      <!-- </router-link> -->
    </div>
  </div>
</template>

<script>
import axios from "axios";
export default {
  mounted() {
    this.findAll();
  },
  name: "MyApp",
  data() {
    return {
      catalogue: [
        {
          levels: "level1-1",
          catalogueName: "Good morning.",
          book: {
            levels: "level1-1",
            bookUrl: "http://lya.ntgyou.cn/m/11128-22060Q644557.jpg"
          }
        },
        {
          levels: "level1-1",
          catalogueName: "Helloween.",
          book: {
            levels: "level1-1",
            bookUrl: "http://lya.ntgyou.cn/m/11128-22060Q644557.jpg"
          }
        }
      ]
    };
  },
  methods: {
    findAll() {}
  }
};
</script>

 
<style scoped>
.register {
  /* //固定外层盒子,不受其他盒子影响
//放在最底层 */
  position: fixed;
  top: 0;
  left: 0;
  z-index: -1;
}
.link_1:hover {
  background: #d0ff00;
}

.link_4:hover {
  color: #2216d1;
}

.link_2:hover {
  font-size: 300px;
}

.link_3:hover {
  background: #d0ff00;
}

.image {
  width: 320px;
  height: 100px;
}

.box {
  box-shadow: 0 0 1px 3px #ecc206;
  margin-top: -83px;
  height: 90px;
  width: 90px;
  margin-left: -55px;
  /* 圆形 */
  border-radius: 50%;
  font-size: 50px;
  font-weight: 1000;
  text-align: center;
}
.boxtext {
  line-height: 85px;
  display: inline-block;
  color: rgba(8, 27, 241, 0.882);
  text-align: center;
}
.box-text {
  font-size: 12px;
}

.boxtop {
  box-shadow: 0 0 1px 3px #d81c1c;

  /* 给父盒子设置相对定位 */
  position: relative;
  width: 300px;
  height: 80px;
  /* 让父盒子水平居中 */
  /* margin: 0 auto; */
  margin-left: 50px;
  margin-top: 30px;

  /* 边框圆角 */
  border-top-right-radius: 10px;
  /* border-top-left-radius:10px; */
  border-bottom-right-radius: 10px;
  /* border-bottom-left-radius:10px; */
}
.index {
  /* 给父盒子设置相对定位 */
  position: relative;
  width: 360px;
  height: 85px;
  /* 让父盒子水平居中 */
  margin: 0 auto;
  margin-top: 30px;
}

.boxright {
  display: flex;
  /* box-shadow: 0 0 1px 3px #ecc206; */
  width: 240px;
  height: 80px;
  margin-left: 50px;
  justify-content: center;
  align-items: center;
  color: rgba(8, 27, 241, 0.882);
  font-weight: 1000;
  font-size: 20px;
}
</style>

效果

 

标签:遍历,margin,top,height,vue,radius,font,数据,left
From: https://www.cnblogs.com/xbinbin/p/17155782.html

相关文章

  • vue图片热区map-area定位(适应屏幕)
    vue代码<template><div>{{screenWidth}}{{screeHeight}}<divv-for="(item,index)inbook":key="index"><!--当从后台获取数据的时候可以进行......
  • 网络数据请求get&post
                   ......
  • 数据探索实例
    一、数据质量分析(一)箱型图分析箱型图提供了识别异常值的一个标准:异常值通常被定义为小于QL-1.5IQR或大于QU+1.5IQR的值。箱型图识别异常值的结果比较客观,在识别异常值方......
  • vue获取屏幕长宽
    vue代码<template><div>寬:{{screenWidth}}高:{{screeHeight}}</div></template><script>exportdefault{data(){return{screenWidth:1000,//......
  • 用Python画数据分析第三章的图
    importpandasaspdcatering_sale="D:\数据分析\catering_sale.xls"data=pd.read_excel(catering_sale,index_col=u'日期')print(data.describe())importmatplot......
  • 数据挖掘python画各类图
    1importpandasaspd2importnumpyasnp3catering_sale='D:\data\catering_fish_congee(1).xls'#餐饮数据4data=pd.read_excel(catering_sale,names=......
  • 【LeetCode二叉树#07】左叶子节点之和(基于栈的迭代法前中后序遍历复习)
    左叶子节点之和力扣题目链接(opensnewwindow)计算给定二叉树的所有左叶子之和。示例:思路注意审题,这里是要求左叶子节点之和不是二叉树中的左侧节点之和,因此使用......
  • 2022-2023-2 20221320 数据结构第一周学习总结
    一、教材学习内容总结:1.周一的课上复习了冯·诺依曼模型:输入设备,输出设备(IO设备),存储器,运算器,控制器(CPU)。计算机由硬件(裸机)和软件(系统软件与应用软件)组成(软件是程序、数......
  • 数据探索
                  ......
  • python数据挖掘绘图
    importpandasaspdcatering_sale=(r'D:\数据挖掘\catering_sale.xls')data=pd.read_excel(catering_sale,index_col='日期')print(data.describe())   importma......