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

Details on macrotasks and microtasks in JavaScript

Table of contents 1. What are microtasks? 2. What...

Detailed process of changing apt source to Alibaba Cloud source in Ubuntu 18.04

Table of contents Preface: Ubuntu 18.04 changes a...

The pitfalls and solutions caused by the default value of sql_mode in MySQL 5.7

During normal project development, if the MySQL v...

HTML tutorial, easy to learn HTML language (2)

*******************Introduction to HTML language (...

How to set up jar application startup on CentOS7

Pitfalls encountered during project deployment Wh...

Analysis of Linux boot system methods

This article describes how to boot the Linux syst...

How to change the root password in MySQL 5.7

Starting from MySQL 5.7, many security updates ha...

CentOS method to modify the default ssh port number example

The default ssh port number of Linux servers is g...

Mysql WorkBench installation and configuration graphic tutorial

This article shares with you the installation and...

Vue implements internationalization of web page language switching

1. Basic steps 1: Install yarn add vue-i18n Creat...

A brief discussion on the design and optimization of MySQL tree structure tables

Preface In many management and office systems, tr...