uniapp的组件

内置组件

icon --- 图标

html 复制代码
<icon :type="contact" size="26"/>

text --- 文本

html 复制代码
<view class="text-box" scroll-y="true">
	<text>{{text}}</text>
</view>

progress --- 进度条

html 复制代码
<view class="progress-box">
	<progress :percent="pgList[0]" show-info stroke-width="3" />
</view>

button --- 按钮

html 复制代码
<button type="primary">页面主操作 Normal</button>
<button type="primary" loading="true">页面主操作 Loading</button>
<button type="warn">警告类操作 Normal</button>

<button type="primary" plain="true">按钮</button>
<button class="mini-btn" type="primary" size="mini">按钮</button>

checkbox --- 复选框

html 复制代码
<view>
	<checkbox-group>
		<label>
			<checkbox value="cb" :checked="true" />选中
		</label>
		<label>
			<checkbox value="cb" />未选中
		</label>
	</checkbox-group>
</view>

editor --- 文本编辑器

富文本编辑器,可以对图片、文字格式进行编辑和混排

html 复制代码
<view class="editor-wrapper">
	<editor id="editor" class="ql-container" placeholder="开始输入..." show-img-size show-img-toolbar
						show-img-resize @statuschange="onStatusChange" :read-only="readOnly" @ready="onEditorReady">
	</editor>
</view>

input --- 单行输入框

html 复制代码
<view class="uni-form-item uni-column">
	<view class="title">可自动聚焦的input</view>
	<input class="uni-input" focus placeholder="自动获得焦点" />
</view>

picker --- 选择器

html 复制代码
<view>
	<view class="uni-title uni-common-pl">地区选择器</view>
	<view class="uni-list">
		<view class="uni-list-cell">
			<view class="uni-list-cell-left">
				当前选择
			</view>
			<view class="uni-list-cell-db">
				<picker @change="bindPickerChange" :value="index" :range="array">
					<view class="uni-input">{{array[index]}}</view>
				</picker>
			</view>
		</view>
	</view>

	<view class="uni-title uni-common-pl">时间选择器</view>
	<view class="uni-list">
		<view class="uni-list-cell">
			<view class="uni-list-cell-left">
				当前选择
			</view>
			<view class="uni-list-cell-db">
				<picker mode="time" :value="time" start="09:01" end="21:01" @change="bindTimeChange">
					<view class="uni-input">{{time}}</view>
				</picker>
			</view>
		</view>
	</view>

	<view class="uni-title uni-common-pl">日期选择器</view>
	<view class="uni-list">
		<view class="uni-list-cell">
			<view class="uni-list-cell-left">
				当前选择
			</view>
			<view class="uni-list-cell-db">
				<picker mode="date" :value="date" :start="startDate" :end="endDate" @change="bindDateChange">
					<view class="uni-input">{{date}}</view>
				</picker>
			</view>
		</view>
	</view>

</view>

switch --- 开关

html 复制代码
<view class="uni-list">
	<view class="uni-list-cell uni-list-cell-pd">
		<view class="uni-list-cell-db">开启中</view>
		<switch checked />
	</view>
	<view class="uni-list-cell uni-list-cell-pd">
		<view class="uni-list-cell-db">关闭</view>
		<switch />
	</view>
</view>

image --- 图片

html 复制代码
<image style="width: 200px; height: 200px; background-color: #eeeeee;" :mode="item.mode" :src="src"></image>

video --- 视频

html 复制代码
<video id="myVideo" src="https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/2minute-demo.mp4"
                    @error="videoErrorCallback" :danmu-list="danmuList" enable-danmu danmu-btn controls></video>

danmu弹幕相关

swiper --- 轮播图

html 复制代码
<view class="uni-margin-wrap">
		<swiper class="swiper" circular :indicator-dots="indicatorDots" :autoplay="autoplay" :interval="interval"
				:duration="duration">
		<swiper-item>
			<view class="swiper-item uni-bg-red">A</view>
		</swiper-item>
		<swiper-item>
			<view class="swiper-item uni-bg-green">B</view>
		</swiper-item>
		<swiper-item>
			<view class="swiper-item uni-bg-blue">C</view>
		</swiper-item>
	</swiper>
</view>

扩展组件

uni-icons --- 图标

html 复制代码
<uni-icons type="contact" size="30"></uni-icons>
相关推荐
梦曦i16 小时前
RouterLink H5端控制台错误修复
前端·uni-app
00后程序员张1 天前
Windows / Linux / Mac 上不用 Xcode 把 IPA 上传到 App Store,upload 命令详解
android·ios·小程序·https·uni-app·iphone·webview
风月说与山鬼1 天前
八、uni-app页面调用接口
uni-app
梦梦代码精2 天前
基于UniApp+Vue3+ThinkPHP 8,这套知识付费系统的架构设计有点东西
java·低代码·docker·uni-app·开源·php
风月说与山鬼2 天前
三、uni-app页面配置(pages.json)
前端·uni-app
风月说与山鬼2 天前
二、uni-app入口文件(main.js)
javascript·uni-app
xiaopang3 天前
一次小程序 Canvas 海报真机调试复盘:从空白导出到 iOS 保存失败
uni-app
MrFlySand_飞沙3 天前
uniapp开发微信小程序实现接入企业微信客服
微信小程序·小程序·uni-app·企业微信
PedroQue994 天前
Vue Router 4.x风格导航守卫全面升级
前端·uni-app
Haibakeji4 天前
APP小程序定制开发项目频繁延期?前期规避方法与落地避坑指南
小程序·uni-app·软件需求