uniapp学习

简单案例

hover-class按下改变样式 ,hover-stay-time展示多久,以毫秒计算

<script setup>
	
</script>

<template>
<view class="layout">
	<view class="box1">1</view>
	<view class="box2">2</view>
	<view class="box3" hover-class="boxHover">3</view><!--hover-class按下改变样式  -->
	
</view>
</template>

<style lang="scss">
	.layout{
		border: 1px solid red;
		.box2{
			border: 1px solid beige;
		}
		.box1{
			border: 1px solid gray;
		}
	}
	.boxHover{
		background-color: #5555ff;
	}
</style>

text

<script setup>
	
</script>

<template>
<view>
	<!--selectable文本是否可选,space空格  -->
	<text selectable="true" space="emsp">aaaaaa aaaaaaaa</text>
</view>

</template>

<style lang="scss">

</style>

sroll-view 可滚动视图区域

<script setup>
	
</script>

<template>
<view>
	<scroll-view scroll-y="true" class="scrollview">
		<view>1</view>
		<view>2</view>
		<view>2</view>
		<view>2</view>
		<view>2</view>
		<view>2</view>
		<view>2</view>
		<view>2</view>
		<view>2</view>
		<view>2</view>
		<view>2</view>
	</scroll-view>

</view>

</template>

<style lang="scss">
	.scrollview{
		width: 80%;
		height: 100px;
		border: 1px solid red;
	}

</style>

swiper 轮播图

<script setup>
	
</script>

<template>
<view>
	<!-- indicator-dots 是否显示面板指示点 -->
	<!-- indicator-color 指示点颜色(未加载的那几个) -->
	<!-- indicator-active-color 	当前选中的指示点颜色 -->
	<!-- circular是否采用衔接滑动,即播放到末尾后重新回到开头 -->
	<!-- autoplay 是否自动切换 5s-->
	<!-- interval 自动切换时长 -->
	<!-- vertical 竖向 -->
	<swiper indicator-dots indicator-color= #007aff indicator-active-color= #dd524d 
	circular autoplay interval="2000" vertical>
		<swiper-item>1</swiper-item>
		<swiper-item>2</swiper-item>
		<swiper-item>3</swiper-item>
		<swiper-item>4</swiper-item>
	</swiper>

</view>

</template>

<style lang="scss">
	swiper{
		swiper-item{
			width: 100%;
			height: 100%;
			background-color: olive;
		
		}
		// 选择最后一个元素:nth-last-child(n)
		// 选择奇数元素:nth-child(2n+1)
		// 选择所有偶数索引的子元素
		swiper-item:nth-child(2n){
			background-color:orange;
			}
	}


</style>

image图片

<script setup>
	
</script>

<template>
<view>
	<image src="../../static/logo.png" mode="aspectFill" class="image"></image>

</view>

</template>

<style lang="scss">


</style>

 
navigator跳转页面

 

<script setup>
	
</script>

<template>
<view >
<navigator url="/pages/demo/demo" open-type="reLaunch">
	<image src="../../static/logo.png"></image>
</navigator>

</view>

</template>

<style lang="scss">


</style>

 button

 

<script setup>
	
</script>

<template>
<view >
<!-- 	size 按钮的大小		
	type 按钮的样式类型		
	plain 按钮是否镂空,背景色透明		
	disabled 是否禁用		
	loading 名称前是否带 loading 图标 -->
<button size="default" type="primary"  >登录</button>
</view>

</template>

<style lang="scss">


</style>

input

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值