当前位置:网站首页>Uniapp tips - scrolling components
Uniapp tips - scrolling components
2022-07-03 13:54:00 【Cloud and cloud discoloration 1】
The recent project made an information display , The customer's needs have changed , Because there are too many displays on one screen , Want multiple screens , Without paging , You can only add scrolling .
Inquired a lot of information , Also tested many components , Finally, a scrolling component is selected . How to use it is as follows :
1、 find uniapp Component plug-in market
https://ext.dcloud.net.cn/
Search scroll
Find... In it MAOUI The scrolling component of
2、 Click to enter the component information page , choice hbuilder Import plug-ins to install automatically
3、 Check whether the component has been added to the project to be added
4、 Page reference components that need to be used
import maoScroll from '@/components/mao-scroll/mao-scroll.vue';
export default {
components: {
maoScroll
},
5、 Corresponding to the required data and setting items on the required page
Here you can use the example of dynamic data in the interface to test , If it is a static example , Comment on the setting method
【 Some people may write static data directly to test , You will think it doesn't show ( Because there is a lack of ). data:{ immediate: true, handler(nVal, oVal) { this.init(); } }】
I didn't understand this paragraph , There is a clear God to explain . I solved it this way :
mounted() {
this.init();
},
And then on the page data part :
data() {
return{
data: this.datas,// This is the static data written in advance that needs to be scrolled
count: 30,
showNum: 5,
lineHeight: 60,
animationScroll: 800,
animation: 2000,
}
}
Page part :
<maoScroll :data="data" :showNum="showNum" :lineHeight="lineHeight" :animationScroll="animationScroll" :animation="animation">
<template v-slot="{line}">
<view class="line">
<view class="col1">{ {line.col1}}</view>
<view class="col2">{ {line.col2}}</view>
<view class="col3">{ {line.col3}}</view>
</view>
</template>
</maoScroll>
6、 Set the style
It can be modified according to your own needs , This style is mainly aimed at h5 edition , So... Is adopted px
<style>
.col3{ width: 60px; text-align: center; display: inline-block;font-size: 12px; line-height: 20px;overflow: hidden; white-space:nowrap;}
.col1{ width: 60px; text-align: center; display: inline-block; font-size: 12px;line-height: 20px;overflow: hidden;white-space:nowrap;}
.col2{ width: 60px; text-align: center; display: inline-block; font-size: 12px;line-height: 20px; overflow: hidden;white-space:nowrap;}
</style>
7、 success
This is the official finished product , Borrow one
The problems encountered in the middle have finally been solved , I'm still very happy , Accumulation accumulation .
Related links :
https://ext.dcloud.net.cn/
https://ext.dcloud.net.cn/plugin?id=4850
边栏推荐
- Go language web development series 25: Gin framework: using MD5 to verify the signature for the interface station
- KEIL5出现中文字体乱码的解决方法
- SQL Injection (GET/Search)
- Open PHP error prompt under Ubuntu 14.04
- Qt学习20 Qt 中的标准对话框(中)
- Solve MySQL 1045 access denied for user 'root' @ 'localhost' (using password: yes)
- GoLand 2021.2 configure go (go1.17.6)
- Error running 'application' in idea running: the solution of command line is too long
- Sequence table (implemented in C language)
- MySQL 数据增删改查综合案例
猜你喜欢
又一个行业被中国芯片打破空白,难怪美国模拟芯片龙头降价抛售了
JVM系列——概述,程序计数器day1-1
【BW16 应用篇】安信可BW16模组与开发板更新固件烧录说明
Qt学习17 对话框及其类型
太阳底下无新事,元宇宙能否更上层楼?
GoLand 2021.1.1: configure the multi line display of the tab of the open file
Richview trvstyle liststyle list style (bullet number)
Flutter dynamic | fair 2.5.0 new version features
There is nothing new under the sun. Can the meta universe go higher?
核酸修饰的金属有机框架药物载体|PCN-223金属有机骨架包载Ad金刚烷|ZIF-8包裹阿霉素(DOX)
随机推荐
windos 创建cordova 提示 因为在此系统上禁止运行脚本
[quantitative trading] permanent portfolio, turtle trading rules reading, back testing and discussion
Use and design of Muduo buffer class
AI scores 81 in high scores. Netizens: AI model can't avoid "internal examination"!
Record 405 questions about bank callback post request
挡不住了,国产芯片再度突进,部分环节已进到4nm
Realize the recognition and training of CNN images, and process the cifar10 data set and other methods through the tensorflow framework
实现CNN图像的识别和训练通过tensorflow框架对cifar10数据集等方法的处理
Mysql:insert date:SQL 错误 [1292] [22001]: Data truncation: Incorrect date value:
Stack application (balancer)
Solve MySQL 1045 access denied for user 'root' @ 'localhost' (using password: yes)
Flutter动态化 | Fair 2.5.0 新版本特性
TensorBoard可视化处理案例简析
Halcon combined with C # to detect surface defects -- Halcon routine autobahn
全面发展数字经济主航道 和数集团积极推动UTONMOS数藏市场
太阳底下无新事,元宇宙能否更上层楼?
MySQL 数据处理值增删改
Common network state detection and analysis tools
The solution of Chinese font garbled code in keil5
logback日志的整理