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

uniapp+vue3的defineProps传递

//index.vue
<view class="topic"><!-- 磨砂背景 --><view class="content"><matte v-for="(item,index) in 8" :key="index"></matte><matte isMore="false"></matte></view></view>
<style scoped lang="scss">
.topic{margin-top: 20rpx;.content{margin-top: 30rpx;display: grid;gap:10rpx;grid-template-columns: repeat(3,1fr);}}
</style>
//全局组件matte
<template><view class="matte"><navigator class="box" url="" v-if="!isMore"> <image class="pic" src="../../common/images/classify1.jpg" mode="aspectFill"></image><view class="top">· 12小时前更新</view><view class="bottom">明星美女</view></navigator><!-- 更多 --><navigator class="box more" url="" v-else><image class="pic" url="../../common/images/more.jpg"></image><view class="bottom"><uni-icons type="more-filled" size="30" color="#fff"></uni-icons><view class="text">更多</view></view></navigator></view>
</template><script setup>
defineProps({isMore:{type:Boolean,default:false}
})	
</script><style lang="scss">.matte{.box{height: 340rpx;border-radius: 10rpx;overflow: hidden;position: relative;.pic{width: 100%;height: 100%;}.top{position: absolute;top:0;left:0;background: rgba(250,129,90,0.7);padding:4rpx 16rpx;font-size: 22rpx;//最小字体color: #fff;transform: scale(0.8);//缩小字体transform-origin: left top;//缩小字体不会移动位置border-radius: 0 0 20rpx 0;}.bottom{width: 100%;position: absolute;display: flex;align-items: center;justify-content: center;left: 0;bottom:0;height: 70rpx;background-color: rgba(0,0,0,0.2);backdrop-filter: blur(20rpx);//磨砂效果color: #fff;font-size: 30rpx;}}.box.more{.bottom{width: 100%;height: 100%;flex-direction: column;}.text{font-size: 28rpx;}}}
</style>


http://www.mrgr.cn/news/5518.html

相关文章:

  • 防爆气象仪的工作原理
  • CTFHUB | web进阶 | JSON Web Token | 无签名
  • C# 泛型
  • 理解现代前端开发:从HTML到React的进化之路
  • 浅谈Spring Boot
  • Python 如何使用 functools 模块
  • Go RPC 和 gRPC 技术详解
  • 学习Math.random()的应用
  • 前端html+js实现懒加载的两种常见方法
  • 一文弄懂 LLM 结构化数据生成原理
  • 基于Python自动连接汕头大学校园网
  • Axios介绍;前后端分离开发的介绍;YAPI的使用;Vue项目简介、入门;Elementui的使用;nginx介绍
  • 支付宝开放平台-开发者社区——AI 日报「8 月23 日」
  • BaseCTF WEEK1 re复现-入土为安的第24天
  • halcon1
  • [Linux#40][线程] 线程控制 | 多线程
  • 设计模式六大原则:迪米特法则详细说明和案例示范
  • windows docker 执行apt-get 权限问题
  • 大数据-95 Spark 集群 SparkSQL Action与Transformation操作 详细解释与测试案例
  • Vue3 provide(父) + inject(子、子的子...)进行值的传递及显示