uniapp常用标签

一.uni-app常用标签

该组件类似HTML中的<a>组件,但只能跳转本地页面。目标页面必须在pages.json中注册
二. 标签用法
1.view
类似于HTML中的div标签通常用于布局和包裹其他标签


2.scroll-view
在指定的区域设置一块可以左右滚动的区域,通常用于下拉刷新和商品主体部分


代码示例
<template>
    <scroll-view class="scrollview" scroll-y="true">
        <view class="box">0</view>
        <view class="box">1</view>
        <view class="box">2</view>
        <view class="box">3</view>
        <view class="box">4</view>
        <view class="box">5</view>
        <view class="box">6</view>
        <view class="box">7</view>
        <view class="box">8</view>
        <view class="box">9</view>
    </scroll-view>
</template>
 
<script>
 
</script>
 
<style>
    .scrollview {
        height: 100px;
        border: 1px solid red;
        white-space: nowrap;
    }
 
    .box {
        widows: 100px;
        height: 100px;
        background-color: aqua;
 
    }
</style>

3.swiper
用于制作轮播图


代码示例
<template>
<swiper class="swiper" indicator-dots autoplay interval="1000">
    <swiper-item class="swiperview">111</swiper-item>
    <swiper-item class="swiperview">222</swiper-item>
    <swiper-item class="swiperview">333</swiper-item>
    <swiper-item class="swiperview">444</swiper-item>
    </swiper>
</template>
 
<script>
 
</script>
 
<style>
    .swiper {
        height: 100px;
        border: 1px solid red;
        white-space: nowrap;
    }
 
    .swiperview {
        widows: 100px;
        height: 100px;
        background-color: aqua;
 
    }
</style>

4.image
相对于HMTL中的img,用于展示图片


代码示例
<template>
    <scroll-view class="scrollview" scroll-y="true">
        <image src="../../static/1.jpeg" class="imger"></image>
        <image src="../../static/2.jpeg" class="imger"></image>
        <image src="../../static/3.png" class="imger"></image>
        <image src="../../static/4.jpg" class="imger"></image>
        <image src="../../static/5.png" class="imger"></image>
    </scroll-view>
</template>
 
<script>
 
</script>
 
<style>
    .scrollview {
        height: 280px;
        border: 1px solid red;
    }
</style>

5.text

6.navigator


7.button

  • 13
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

magic33416563

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值