Ionic4.x 中的 UI 组件(UI Components) Slides 轮播图组件、Searchbar 组件、 Segment 组件
Slides 轮播图组件
Ionic4.x 中的轮播图组件是基于 swiper 插件,所以配置 slides 的属性需要在 swiper 的 api 中
找
Swiper Api:http://idangero.us/swiper/api/
<ion-header>
<ion-toolbar>
<ion-buttons slot="start">
<ion-back-button defaultHref="/tabs/tab1" text="返回"></ion-back-button>
</ion-buttons>
<ion-title>slides</ion-title>
</ion-toolbar>
</ion-header>
<ion-content padding>
<ion-slides pager="true" [options]="slideOpts" #slide1 (ionSlideTouchEnd)="slideDidChange()">
<ion-slide>
<img src="/assets/slide01.png" alt="">
</ion-slide>
<ion-slide>
<img src="/assets/slide02.png" alt="">
</ion-slide>
</ion-slides>
<br>
<ion-slides pager="true" #slide2>
<ion-slide>
<img src="/assets/slide02.png" alt="">
</ion-slide>
<ion-slide>
<img src="/assets/slide01.png" alt="">
</ion-slide>
<ion-slide>
<img src="/assets/02.png" alt="">
</ion-slide>
<ion-slide>
<img src="/assets/02.png" alt="">
</ion-slide>
</ion-slides>
<ion-button (click)="slideNext()">
点击按钮跳转到下一页
</ion-button>
<ion-button (click)="slidePrev()">
点击按钮跳转到上一页
</ion-button>
</ion-content>
Searchbar 组件
<ion-header>
<ion-toolbar>
<ion-buttons slot="start">
<ion-back-button defaultHref="/tabs/tab1" text="返回"></ion-back-button>
</ion-buttons>
</ion-toolbar>
</ion-header> <ion-content padding>
<ion-searchbar placeholder="Filter Schedules"></ion-searchbar>
<ion-searchbar placeholder="请输入搜索的内容" animated></ion-searchbar>
<ion-searchbar placeholder="请输入搜索的内容" animated type="number"></ion-searchbar>
<ion-searchbar placeholder="请输入搜索的内容" animated color="success"></ion-searchbar>
<ion-searchbar placeholder="文本框改变" debounce="500" (ionChange)="doChange()"></ion-searchbar>
</ion-content>
<ion-header>
<ion-toolbar> <ion-buttons slot="start">
<ion-back-button defaultHref="/tabs/tab1" text="返回"></ion-back-button>
</ion-buttons>
<ion-title>segment</ion-title>
</ion-toolbar>
</ion-header> <ion-content padding> <ion-segment [(ngModel)]="tab">
<ion-segment-button value="tab1">
<ion-label>简介</ion-label>
</ion-segment-button>
<ion-segment-button value="tab2">
<ion-label>详情</ion-label>
</ion-segment-button>
<ion-segment-button value="tab3">
<ion-label>评论</ion-label>
</ion-segment-button>
</ion-segment> <div class="info" [ngSwitch]="tab"> <div *ngSwitchCase="'tab1'">
商品简介 --注意ngSwitchCase写法
</div> <div *ngSwitchCase="'tab2'">
商品详情 </div>
<div *ngSwitchCase="'tab3'">
商品评论
</div>
</div>
</ion-content>
Ionic4.x 中的 UI 组件(UI Components) Slides 轮播图组件、Searchbar 组件、 Segment 组件的更多相关文章
- 告别组件之教你使用原生js和css写移动端轮播图
在工作中由于项目需要要写一个轮播图,本想使用组件直接调用实现快速开发,但是一想到自己经常使用组件但是让自己手写的话确实一点都不会. 一个不会手写组件的前端程序员不是一个好程序员!于是打算自己手写一个. ...
- 使用原生js将轮播图组件化
代码地址如下:http://www.demodashi.com/demo/11316.html 这是一个轮播图组件,这里是代码地址,需要传入容器的id和图片地址,支持Internet Explor ...
- React Native 之轮播图swiper组件
注释:swiper组件是第三方组件 所以在使用之前应该先在命令行安装,然后将第三方的模块引入(第三方模块地址:https://github.com/leecade/react-native-swipe ...
- 在Nuxt中使用react-id-swiper封装公共的轮播图组件(移动端
首先就是引入swiper import Swiper from 'react-id-swiper': 一个轮播图首先要考虑到一种情况就是当只有一张图的时候是不是需要按轮播图来处理 一般情况下,一张图是 ...
- 前端笔记之JavaScript面向对象(四)组件化开发&轮播图|俄罗斯方块实战
一.组件化开发 1.1组件化概述 页面特效的制作,特别需要HTML.CSS有固定的布局,所以说现在越来越流行组件开发的模式,就是用JS写一个类,当你实例化这个类的时候,页面上的效果布局也能自动完成. ...
- nativescript——轮播图组件
import { Directive, ElementRef, AfterViewInit, Input, OnDestroy } from "@angular/core"; im ...
- vue移动音乐app开发学习(三):轮播图组件的开发
本系列文章是为了记录学习中的知识点,便于后期自己观看.如果有需要的同学请登录慕课网,找到Vue 2.0 高级实战-开发移动端音乐WebApp进行观看,传送门. 完成后的页面状态以及项目结构如下: 一: ...
- vue-cli中轮播图vue-awesome-swiper使用方法
1 npm 安装 npm install vue-awesome-swiper --save 2在所用的组件中引入 import 'swiper/dist/css/swiper.css' import ...
- Vue实现音乐播放器(七):轮播图组件(二)
轮播图组件 <template> <div class="slider" ref="slider"> <div class=&qu ...
随机推荐
- iview DatePicker 只能选本月
html <FormItem label="活动时间" prop="activity_time"> <DatePicker v-model=& ...
- 异常-java.util.concurrent.TimeoutException: Futures timed out after [100000 milliseconds]
1 详细异常 java.util.concurrent.TimeoutException: Futures timed out after [100000 milliseconds] at scala ...
- Python基础——运行机理
Python解释器 从Python这门编程语言的实现上来讲,Python是一个名为解释器的软件包,包含:一个解释器 和 支持的库 解释器又有不同版本:CPython.Jython.IronPython ...
- Nginx access_log日志添加返回字段
主要为方便单用户请求日志回溯分析 记录用户标记. 将用户信息打印在access_log 日志里. 步骤: 1.重写nginx 的log格式 一般是地址是 /etc/nginx/conf.d/ng ...
- python RSA加密、解密、签名
python RSA加密.解密.签名 python中用于RSA加解密的库有好久个,本文主要讲解rsa.M2Crypto.Crypto这三个库对于RSA加密.解密.签名.验签的知识点. 知识基础 加密是 ...
- Oracle LOB 大对象处理
LOB类型列主要是用来存储大量数据的数据库字段,最大可以存储4G字节的非结构化数据. 一.LOB数据类型分类 1.按存储数据的类型分: ①字符类型: CLOB:存储大量 单字节 字符数据. N ...
- Spark RDD 到 LabelPoint的转换(包含构造临时数据的方法)
题目: 将数据的某个特征作为label, 其他特征(或其他某几个特征)作为Feature, 转为LabelPoint 参考: http://www.it1352.com/220642.html 首先构 ...
- javascript权威指南第12章DOM2 DOM3 示例代码
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <title> Example XHTML ...
- 学到了林海峰,武沛齐讲的Day20 装饰器
import time def timmer(func): #func=test 装饰器架构 def wrapper(): start_time=time.time() func() #就是在运行te ...
- Greenplum table 之 外部表
转载自: https://www.cnblogs.com/kingle-study/p/10552097.html 一.外部表介绍 Greenplum 在数据加载上有一个明显的优势,就是支持数据的并发 ...