当前位置:网站首页>Ionic4 learning notes 10 rotation map of an East Project
Ionic4 learning notes 10 rotation map of an East Project
2022-07-24 18:24:00 【tongle_ deng】
1、 Page component definition
<ion-content>
<!-- Shuffling figure
#slide1 : As component ID
[options]="slidesOpts": Corresponding ts Objects configured in slidesOpts, It belongs to component attribute configuration
*ngFor="let item of slidesList" : Get backstage ts Data passed in
*(ionSlideTouchEnd)="slideTouchEnd()": The method of starting after manual sliding
-->
<ion-slides pager="true" #slide1 [options]="slidesOpts" (ionSlideTouchEnd)="slideTouchEnd()">
<ion-slide *ngFor="let item of slidesList">
<img [src]="item.pic" />
</ion-slide>
</ion-slides>
</ion-content>2、 Data sources
2.1 Pictures have been placed in src/assets Under the document
2.2 stay tab1 Of ts Edit logic in the file
@ViewChild('slide1') slide1; // Get the id by slide1 The components of , The premise needs to be import Introduction in ViewChild
// Properties of the carousel map
public slidesOpts={
speed:400,// Time from one page to the next
autoplay: {
delay: 2000,// How often does it rotate
},
loop:true // Whether to circulate
}
public slidesList:any[]=[];
constructor(){
// Data source of rotating pictures
for(var i=1;i<=3;i++){
this.slidesList.push({
pic:'assets/slide0'+i+'.png',
url:'',
})
}
}
// Manual sliding is completed
slideTouchEnd(){
this.slide1.startAutoplay();// Set to automatic rotation
}3、 Set up CSS( stay tab1 Of css In file )
// Of a carousel Css Control picture size
ion-slide{
width: 100%;
height: 150px;
overflow: hidden;
img{
max-width: 100%;
}
}
边栏推荐
- 缺失值处理
- The collapse of margin
- Pytorch的旅程一:线性模型
- redis集群的三种方式
- Bib | mol2context vec: context aware deep network model learning molecular representation for drug discovery
- 2. JS variable type conversion, automatic conversion, manual conversion, what is the difference between parseint(), parsefloat(), number()?
- Growth of operation and maintenance Xiaobai - week 8 of Architecture
- Inoic4 learning notes 2
- 3. Variable declaration promotion?
- 移动端实现0.5px的实用方案
猜你喜欢

5. Reference type and value type as function parameters?

如何用WebGPU流畅渲染百万级2D物体?

Shanghai Jiaotong University team used joint deep learning to optimize metabonomics research

根证书的有效期与服务器SSL证书一样长吗?

下拉列表组件使用 iScroll.js 实现滚动效果遇到的坑

Web penetration experience summary ing

关于接口的写法 1链式判读 ?. 2方法执行 (finally)一定会执行

剑指 Offer 21. 调整数组顺序使奇数位于偶数前面

第五届数字中国建设峰会在福建福州开幕

怎么解决idea中yaml无法识别或者飘红?
随机推荐
Introduction and use of Pinia
ORM introduction and database operation
MySQL configuration file
Admin component
Web penetration experience summary ing
奶头乐理论介绍及个人感悟
Section 10 cache breakdown follow Daewoo redis ------- directory post
Escape character in JS?
Model saving and loading of sklearn
Cf. bits and pieces (subset pressing DP + pruning)
Pytorch的旅程二:梯度下降
剑指 Offer 21. 调整数组顺序使奇数位于偶数前面
颜色的13 个必备方法!
Namespace:集群环境共享与隔离
继承与派生
[OBS] dependency Library: x264 vs Build
JS to achieve progress steps (small exercise)
空间三点画圆代码
Variable and immutable data types
undefined reference to H5PTopen