当前位置:网站首页>Applet sliding, clicking and switching simple UI
Applet sliding, clicking and switching simple UI
2022-07-07 09:48:00 【Dehong demon king】
List of articles
【 Zero foundation wechat applet introduction development 】 Small program introduction and environment construction
【 Zero foundation wechat applet introduction development 】 Configure applets
【 Zero foundation wechat applet introduction development 】 Applet framework 1
【 Zero foundation wechat applet introduction development 】 Applet framework 2
【 Zero foundation wechat applet introduction development 】 Basic ability ( One )
【 Zero foundation wechat applet introduction development 】 Basic ability ( Two )
Applet slide 、 Click to switch succinctly UI
Development encountered , Simply record , Slide the applet or click to switch styles

There's no demonstration here , Go straight to the code
wxml
<view>
<!-- Tab Layout -->
<view class='navBox'>
<view class='titleBox' bindtap='titleClick' data-idx='0'>
<text class="{
{0 == currentIndex ? 'fontColorBox' : ''}}"> Android </text>
<hr class="{
{0 == currentIndex ? 'lineBox' : 'notLineBox'}}" />
</view>
<view class='titleBox' bindtap='titleClick' data-idx='1'>
<text class="{
{1 == currentIndex ? 'fontColorBox1' : ''}}"> Apple </text>
<hr class="{
{1 == currentIndex ? 'lineBox' : 'notLineBox'}} " />
</view>
</view>
<!-- Content layout -->
<swiper class='swiperTtemBox' bindchange='pagechange' current='{
{currentIndex}}'>
<swiper-item class='swiperTtemBox'>
<view> Content 1</view>
</swiper-item>
<swiper-item class='swiperTtemBox'>
<view> Content 2</view>
</swiper-item>
</swiper>
</view>
js
const app = getApp()
Page({
data: {
currentIndex: 0, // Default first
},
pagechange: function (ee) {
if ("touch" === ee.detail.source) {
let currentPageIndex = this.data.currentIndex;
currentPageIndex = (currentPageIndex + 1) % 2;
this.setData({
currentIndex: currentPageIndex,
})
}
},
// Click on tab Trigger when
titleClick: function (e) {
this.setData({
// Get the current index and change it dynamically
currentIndex: e.currentTarget.dataset.idx
})
},
})
Put the code you need to write in the content 1 Replace it , You can easily click or slide the switch window ,js Data interaction can be handled uniformly , The same load is just the layout of the display , Others are the same
️️️️️️ 🥳🥳🥳 Thousands of people , Thank you for reading my article at this moment , Thanks for watching , Hello, everyone , Welcome to the artificial intelligence exchange group ( Watch my news ), More peripheral benefits are waiting for you 🥳🥳🥳
Welcome to subscribe to this column or follow me , Let's work together to solve an algorithm problem every day
️️️ Last , I hope my article can be helpful to your !
I wish myself and you in the future , Keep learning , Keep improving , Keep loving , Go to the mountains and seas ! ️️️
边栏推荐
- Information Security Experiment 2: using x-scanner scanning tool
- Luogu p2482 [sdoi2010] zhuguosha
- CSDN salary increase technology - learn about the use of several common logic controllers of JMeter
- Write VBA in Excel, connect to Oracle and query the contents in the database
- sql 里面使用中文字符判断有问题,哪位遇到过?比如value&lt;&gt;`无`
- Octopus future star won a reward of 250000 US dollars | Octopus accelerator 2022 summer entrepreneurship camp came to a successful conclusion
- Over 100000 words_ Ultra detailed SSM integration practice_ Manually implement permission management
- 其实特简单,教你轻松实现酷炫的数据可视化大屏
- 高斯消元
- 牛客网——华为题库(61~70)
猜你喜欢

AI从感知走向智能认知

Arthas simple instructions
![[Frida practice]](/img/20/fc68bcf2f55b140d6754af6364896b.png)
[Frida practice] "one line" code teaches you to obtain all Lua scripts in wegame platform

【BW16 应用篇】安信可BW16模组/开发板AT指令实现MQTT通讯

细说Mysql MVCC多版本控制

Information Security Experiment 1: implementation of DES encryption algorithm

数据建模中利用3σ剔除异常值进行数据清洗

第一讲:包含min函数的栈

Octopus future star won a reward of 250000 US dollars | Octopus accelerator 2022 summer entrepreneurship camp came to a successful conclusion

Detailed explanation of diffusion model
随机推荐
Communication mode between processes
How to become a senior digital IC Design Engineer (5-3) theory: ULP low power design technology (Part 2)
大佬们,有没有遇到过flink cdc读MySQLbinlog丢数据的情况,每次任务重启就有概率丢数
ViewPager2和VIewPager的區別以及ViewPager2實現輪播圖
Flex flexible layout
Pit using BigDecimal
Lesson 1: finding the minimum of a matrix
细说Mysql MVCC多版本控制
2020ccpc Weihai J - Steins; Game (SG function, linear basis)
CDZSC_2022寒假个人训练赛21级(2)
章鱼未来之星获得25万美金奖励|章鱼加速器2022夏季创业营圆满落幕
[bw16 application] Anxin can realize mqtt communication with bw16 module / development board at instruction
Nested (multi-level) childrn routes, query parameters, named routes, replace attribute, props configuration of routes, params parameters of routes
Dynamics 365online applicationuser creation method change
如何使用clipboard.js库实现复制剪切功能
[4g/5g/6g topic foundation -147]: Interpretation of the white paper on 6G's overall vision and potential key technologies -2-6g's macro driving force for development
Unity shader (data type in cghlsl)
12、 Sort
软件建模与分析
有没有大佬帮忙看看这个报错,有啥排查思路,oracle cdc 2.2.1 flink 1.14.4
