A brief introduction to VUE uni-app basic components

A brief introduction to VUE uni-app basic components

1. scroll-view

When using vertical scrolling, you need to give a fixed height and set the height through CSS; when using horizontal scrolling, you need to add white-space: nowrap ; style.

scroll-y : allows vertical scrolling, scroll-x: allows horizontal scrolling

@scroll : triggered when scrolling, event.detail = {scrollLeft, scrollTop, scrollHeight, scrollWidth, deltaX, deltaY}

Two-way data binding

<template>
	<view>
		<scroll-view class="scroll" scroll-y="true" @scroll="scroll">
			<view v-for="i in 100">{{i}}</view>
		</scroll-view>
	</view>

</template>

<script>
	export default {
		data() {
			return {
				flag:true
			}
		},
		methods: {
			scroll(e){
				console.log(e.detail);
			}
		}
	}
</script>

<style>
	.scroll{
		height:400rpx;
	}
</style>

Summarize

This article ends here. I hope it can be helpful to you. I also hope you can pay more attention to more content on 123WORDPRESS.COM!

You may also be interested in:
  • Detailed explanation of the use of router-view components in Vue
  • Detailed explanation of how to use Teleport, a built-in component of Vue3
  • A brief discussion on VUE uni-app custom components
  • Detailed explanation of Vue development Sort component code
  • A detailed discussion of components in Vue

<<:  Detailed explanation of the buffer pool in MySQL

>>:  XHTML Getting Started Tutorial: Simple Web Page Creation

Recommend

How to optimize the slow Like fuzzy query in MySQL

Table of contents 1. Introduction: 2. The first i...

How to assign default values ​​to fields when querying MySQL

need When querying a field, you need to give the ...

Automatically build and deploy using Docker+Jenkins

This article introduces Docker+Jenkins automatic ...

Six tips to increase web page loading speed

Secondly, the ranking of keywords is also related ...

Example of how to reference environment variables in Docker Compose

In a project, you often need to use environment v...

Pure HTML and CSS to achieve JD carousel effect

The JD carousel was implemented using pure HTML a...

JavaScript Objects (details)

Table of contents JavaScript Objects 1. Definitio...

DockerToolBox file mounting implementation code

When using docker, you may find that the file can...

MySQL 5.7.27 winx64 installation and configuration method graphic tutorial

This article shares the installation and configur...

Installation and daemon configuration of Redis on Windows and Linux

# Installation daemon configuration for Redis on ...

Linux system dual network card binding configuration implementation

System version [root@ ~]# cat /etc/redhat-release...

Easyswoole one-click installation script and pagoda installation error

Frequently asked questions When you are new to ea...

How to use domestic image warehouse for Docker

1. Problem description Due to some reasons, the d...