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>
相关推荐
用户6990304848754 天前
try catch使用场景 处理同步代码错误兼容用的
javascript·uni-app
ITKEY_4 天前
uniapp微信开发者工具 更改AppID失败 touristappid
uni-app
Geek_Vison4 天前
APP瘦身实战:从80MB+砍到15MB——基于小程序容器技术剥离APP非核心业务的实践分享
小程序·uni-app·mpaas
CHB5 天前
HDC2026 演讲实录|AI 驱动的跨端进化:利用 uni-agent 快速构建高性能鸿蒙应用
uni-app·harmonyos
2501_915918415 天前
iOS App性能测试工具的实现方法与优化循环指南
android·ios·小程序·https·uni-app·iphone·webview
斯内普吖5 天前
(开源)高校素拓分管理系统小程序实战指南 基于 Java + SpringBoot + uni-app + Vue + MySQL
java·spring boot·mysql·小程序·uni-app·开源
海阔天空66885 天前
uniapp开启调试模式
uni-app·uniapp开启调试模式
anyup6 天前
分享 5 套 uni-app 实用主题,一键适配暗黑模式
前端·uni-app·视觉设计
gg159357284606 天前
Uni-app跨平台开发全解课程:从零基础到企业级多端落地实战
vue.js·uni-app
xshirleyl8 天前
uniapp小兔鲜儿day3
uni-app