Day2-2:前端项目uniapp壁纸实战

再在wallpaper新建一个目录components

在components下新建组件common-title

记得点击创建同名目录

在index加

<view class="select"><common-title></common-title></view>

图片换了下,原来的有点丑,图片可按自己喜欢在网上下载

加一个select

<view class="select"><common-title></common-title><view class="content"><scroll-view scroll-x><view class="box" v-for="item in 8"><image src="../../common/images/【哲风壁纸】插画艺术-美女.png" mode="aspectFill"></image></view></scroll-view></view></view>

效果如下:

调整一下:

.select{padding-top: 50rpx;.content{width: 720rpx;margin-left: 30rpx;scroll-view{white-space: nowrap;.box{width: 200rpx;height: 430rpx;display: inline-block;margin-right: 15rpx;image{width: 100%;height: 100%;border-radius: 10rpx;}}.box:last-child{margin-right: 30rpx;}}}}

效果如下:

想要好看点就下载多一点图片哈

<view class="select"><common-title></common-title><view class="content"><scroll-view scroll-x><view class="box"><image src="../../common/images/【哲风壁纸】插画艺术-美女.png" mode="aspectFill"></image></view><view class="box"><image src="../../common/images/【哲风壁纸】原画艺术-插画艺术.png"mode="aspectFill"></image></view><view class="box"><image src="../../common/images/【哲风壁纸】柯南-贝尔摩德.png"mode="aspectFill"></image></view><view class="box"><image src="../../common/images/【哲风壁纸】杀生丸-犬夜叉.png"mode="aspectFill"></image></view><view class="box"><image src="../../common/images/【哲风壁纸】IPhone-iPhone壁纸.png"mode="aspectFill"></image></view><view class="box"><image src="../../common/images/【哲风壁纸】Spider-Man-品红色.png"mode="aspectFill"></image></view></scroll-view></view></view>

效果如下:

接下来我们来弄一下公共标题

来到common-title.vue

<template><view class="common-title"><view class="name"><slot name="name"></slot></view><view class="custom"><slot name="custom"></slot></view></view>
</template><script setup></script><style lang="scss" scoped>
.common-title{display: flex;justify-content: space-between;align-items: center;padding: 0 30rpx;.name{font-size: 40rpx;}
}
</style>

再去uniapp官网

下载

按打开

下载好了,最好重启一下哈

拷贝

修改并加上日历图标:

<view class="select"><common-title><template #name>每日推荐</template><template #custom><view class="date"><uni-icons type="calendar" size="18" color="#28b389"></uni-icons><uni-dateformat :date="Date.now()" format="yyyy年MM"></uni-dateformat></view></template></common-title>

.select{padding-top: 50rpx;.date{color:#28b389;display: flex;align-items: center;.text{margin-left: 5rpx;}}

index.vue的完整代码:

<template><view class="homeLayout"><view class="banner"><swiper circular indicator-dots autoplay><swiper-item><image src="../../common/images/【哲风壁纸】动漫-少女插画.png"mode="aspectFill"></image></swiper-item><swiper-item><image src="../../common/images/【哲风壁纸】女孩-黑猫女孩.png"mode="aspectFill"></image></swiper-item></swiper></view><view class="notice"><view class="left"><uni-icons type="sound-filled" size="20" color="#28b389"></uni-icons><text class="text">公告</text></view><view class="center"><swiper vertical autoplay interval="1500"  duration="300" circular><swiper-item v-for="item in 4">欢迎来到Kx......壁纸</swiper-item></swiper></view><view class="right"><uni-icons type="right" size="16" color="#333"></uni-icons></view></view><view class="select"><common-title><template #name>每日推荐</template><template #custom><view class="date"><uni-icons type="calendar" size="18" color="#28b389"></uni-icons><uni-dateformat :date="Date.now()" format="yyyy年MM"></uni-dateformat></view></template></common-title><view class="content"><scroll-view scroll-x><view class="box"><image src="../../common/images/【哲风壁纸】插画艺术-美女.png" mode="aspectFill"></image></view><view class="box"><image src="../../common/images/【哲风壁纸】原画艺术-插画艺术.png"mode="aspectFill"></image></view><view class="box"><image src="../../common/images/【哲风壁纸】柯南-贝尔摩德.png"mode="aspectFill"></image></view><view class="box"><image src="../../common/images/【哲风壁纸】杀生丸-犬夜叉.png"mode="aspectFill"></image></view><view class="box"><image src="../../common/images/【哲风壁纸】IPhone-iPhone壁纸.png"mode="aspectFill"></image></view><view class="box"><image src="../../common/images/【哲风壁纸】Spider-Man-品红色.png"mode="aspectFill"></image></view></scroll-view></view></view><view class="theme"><common-title><template #name>专题精选</template></common-title></view></view>
</template><script setup></script><style lang="scss" scoped>.homeLayout{.banner{width: 750rpx;padding: 30rpx 0;swiper{width: 750rpx;height: 340rpx;swiper-item{width: 100%;height: 100%;padding: 0 30rpx;image{width: 100%;height: 100%;border-radius: 10rpx;}}}}.notice{width: 690rpx;height: 80rpx;line-height: 80rpx;background: #f9f9f9;margin: 0 auto;border-radius: 80rpx;display: flex;.left{width: 140rpx;display: flex;align-items: center;justify-content: center;.text{color: #28b389;font-weight: 600;font-size: 28rpx;}}.center{flex: 1;swiper{height: 100%;swiper-item{height: 100%;font-size: 30rpx;color: #666;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;}}}.right{width: 70rpx;display: flex;align-items: center;justify-content: center;}}.select{padding-top: 50rpx;.date{color:#28b389;display: flex;align-items: center;.text{margin-left: 5rpx;}}.content{width: 720rpx;margin-left: 30rpx;scroll-view{white-space: nowrap;.box{width: 200rpx;height: 430rpx;display: inline-block;margin-right: 15rpx;image{width: 100%;height: 100%;border-radius: 10rpx;}}.box:last-child{margin-right: 30rpx;}}}}}
</style>

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/pingmian/75742.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

其他 vector 操作详解(四十)

介绍 除去向 vector 添加元素&#xff08;如 push_back&#xff09;之外&#xff0c;vector 还提供了许多其他操作&#xff0c;这些操作大多与 string 的操作类似。通过掌握这些操作&#xff0c;我们可以方便地查询、修改和比较 vector 中的元素&#xff0c;从而构建灵活、高效…

【Leetcode 每日一题】368. 最大整除子集

问题背景 给你一个由 无重复 正整数组成的集合 n u m s nums nums&#xff0c;请你找出并返回其中最大的整除子集 a n s w e r answer answer&#xff0c;子集中每一元素对 ( a n s w e r [ i ] , a n s w e r [ j ] ) (answer[i], answer[j]) (answer[i],answer[j]) 都应当…

python基础-13-处理excel电子表格

文章目录 【README】【13】处理Excel电子表格【13.1】Excel文档【13.2】安装openpyxl模块【13.3】读取Excel文档【13.3.1】使用openpyxl模块打开excel文档【13.3.2】从工作簿取得工作表【13.3.3】从工作表sheet获取单元格cell【13.3.5】从表中获取行和列【13.3.6】工作簿、工作…

ABS函数c++

简介&#xff1a; abs 函数用于计算一个数的绝对值&#xff0c;在 C 中它继承自 C 语言的标准库&#xff0c;其历史可以追溯到早期的 C 语言发展历程&#xff0c;以下是详细介绍&#xff1a; 早期编程语言的需求 在计算机编程的早期阶段&#xff0c;处理数学运算就是一项基本…

闭环SOTA!北航DiffAD:基于扩散模型实现端到端自动驾驶「多任务闭环统一」

端到端自动驾驶目前是有望实现完全自动驾驶的一条有前景的途径。然而&#xff0c;现有的端到端自动驾驶系统通常采用主干网络与多任务头结合的方式&#xff0c;但是它们存在任务协调和系统复杂度高的问题。为此&#xff0c;本文提出了DiffAD&#xff0c;它统一了各种驾驶目标并…

整车CAN网络和CANoe

车载网络中主要包含有Can网络,Lin网络,FlexRay,Most,以太网。 500kbps:500波特率,表示的数据传输的速度。表示的是最大的网速传输速度。也就是每秒 500kb BodyCan车身Can InfoCan娱乐信息Can 车身CAN主要连接的是ESB电动安全带 ADB自适应远光灯等 PTCan动力Can 底盘Can

实战设计模式之迭代器模式

概述 与上一篇介绍的解释器模式一样&#xff0c;迭代器模式也是一种行为设计模式。它提供了一种方法来顺序访问一个聚合对象中的各个元素&#xff0c;而无需暴露该对象的内部表示。简而言之&#xff0c;迭代器模式允许我们遍历集合数据结构中的元素&#xff0c;而不必了解这些集…

JVM 垃圾回收器是如何判断一个对象是否要回收?

JVM 垃圾回收器&#xff08;Garbage Collector&#xff09;需要判断哪些对象是“垃圾”&#xff0c;即不再被程序使用的对象&#xff0c;以便回收它们占用的内存。JVM 主要使用以下两种方法来判断对象是否是垃圾&#xff1a; 1. 引用计数算法 (Reference Counting): 原理&…

kali——httrack

目录 前言 使用教程 前言 HTTrack 是一款运行于 Kali Linux 系统中的开源网站镜像工具&#xff0c;它能将网站的页面、图片、链接等资源完整地下载到本地&#xff0c;构建出一个和原网站结构相似的离线副本。 使用教程 apt install httrack //安装httrack工具 httrac…

kotlin函数类型

一 函数类型定义 1 定义 函数类型就是 (Int, Int) -> Int 函数类型其实就是将函数的 “参数类型” 和 “返回值类型” 抽象出来 2 示例 &#xff1a; (Int, Int) -> Int 表示接收两个 Int 参数并返回 Int 的函数类型&#xff1b; (String) -> Unit 表示接收 Strin…

C# Winform 入门(9)之如何封装并调用dll

封装dll 首先创建 .Net平台 类库 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks;namespace _09.Encapsulation_dll {public class Program{/// <summary>/// 求两个double类型的数值的和/// &l…

前后端分离下,Spring Boot 请求从发起到响应的完整执行流程

以下是前后端分离架构下&#xff0c;Spring Boot 请求从发起到响应的完整执行流程&#xff0c;结合你提出的所有问题&#xff0c;按真实执行顺序和职责链条重新整理所有核心概念、结构、关键类、数据转换点和典型代码示例&#xff1a; 一、前端发起请求&#xff08;步骤1-2&…

基于sklearn实现文本摘要思考

和各位小伙伴分享一下使用sklearn进行文本摘要的思考。 第一版本 原理 提取式文本摘要的基本原理是&#xff1a; 将文本分割成句子 计算每个句子的重要性(权重) 选择权重最高的几个句子组成摘要 常用的句子权重计算方法&#xff1a; TF-IDF&#xff1a;基于词频-逆文档频…

OpenHarmony子系统开发 - DFX(三)

OpenHarmony子系统开发 - DFX&#xff08;三&#xff09; 五、HiTraceMeter开发指导 HiTraceMeter概述 简介 HiTraceMeter在OpenHarmony中&#xff0c;为开发者提供业务流程调用链跟踪的维测接口。通过使用该接口所提供的功能&#xff0c;可以帮助开发者迅速获取指定业务流…

2025年 能够有效提升AI的生成质量和逻辑严谨性 的通用型系统提示

以下是三个经过精心设计的通用型系统提示&#xff08;System Prompt&#xff09;&#xff0c;能够有效提升AI的生成质量和逻辑严谨性&#xff0c;适用于各类对话、分析和创作场景&#xff1a; Prompt 1 - 专家级分步验证模式 你是一个具备跨领域知识整合能力的超级AI&#xff…

python爬虫:小程序逆向实战教程

根据我之前发表的文章&#xff0c;我们进行延伸实战https://blog.csdn.net/weixin_64809364/article/details/146981598?spm1001.2014.3001.5501 1. 想要爬取什么小程序&#xff0c;我们进行搜索 2. 找到我们vx小程序的文件地址&#xff0c;我们就可以进行破解 破解步骤强看…

C语言变长数组(VLA)详解:灵活处理动态数据的利器

引言 在C语言中&#xff0c;传统的数组大小必须在编译时确定&#xff0c;这限制了程序处理动态数据的灵活性。C99标准引入的变长数组&#xff08;Variable-Length Array, VLA&#xff09; 打破了这一限制&#xff0c;允许数组长度在运行时动态确定。本文将深入解析VLA的语法、…

串口数据转换为IP数据

串口数据转换为IP数据是一种常见的通信技术,用于将传统的串行设备(如传感器、控制器等)接入现代的IP网络。以下是详细介绍: 1. 转换原理 串口数据转换为IP数据的过程涉及硬件和软件的结合,核心是将串行数据封装为TCP/IP或UDP/IP数据包,通过网络传输。具体步骤如下: 硬…

client-go如何监听自定义资源

如何使用 client-go 监听自定义资源 在 Kubernetes 中使用 client-go 监听自定义资源&#xff08;Custom Resource&#xff0c;简称 CR&#xff09;需要借助 Dynamic Client 或 Custom Informer&#xff0c;因为 client-go 的标准 Clientset 只支持内置资源&#xff08;如 Pod…

C++软件开发架构

文章目录 1.全局消息通信MsgHandler.h单元测试(QTest)MsgHandlerUnitTest.hMsgHandlerUnitTest.cpp 2.实例间通信InstMsgHandler.h单元测试InstMsgHandlerUnitTest.hInstMsgHandlerUnitTest.cpp 1.全局消息通信 1. 适用于类与类单个对象实例之间的通信&#xff0c;多个对象需要…