A brief introduction to VUE uni-app core knowledge

A brief introduction to VUE uni-app core knowledge

specification

a. The page file follows the vue single file component specification

<!-- Template block -->
<template>
	<view class="main">
		{{msg}}
	</view>
</template>
<!-- Script Block -->
<script>
	export default {
		data(){
			return {
				msg:'Hello'
			}
		}
	}
</script>
<!-- Style block -->
<style>
	.main{
		background-color:#ccc;
	}
</style>

b. Component labels are close to the mini-program specifications

<template>
	<view>hello</view>
	<text> wang </view>
</template>

c. Interface capabilities (JS API) are close to WeChat Mini Program specifications

//Get location informationuni.getLocation({
	type:'wgs84',
	success:function(res){
		console.log('Current location longitude: '+res.longitude);
		console.log('Current location latitude: '+res.latitude);
	}
});

e. Data binding and event handling use Vue.js specifications

<template>
	<view @click="changeMsg">
		{{msg}}
	</view>
</template>
<script>
	export default{
		data(){
			return {
				msg:'hello'
			}
		},
		methods:{
			changeMsg(){
				this.msg:'world'
			}
		}
	}
</scrip>

feature

a. Conditional compilation

#ifdef APP-PLUS
	Code that only appears on the APP platform#endif
#ifndef H5
	 Except for the H5 platform, the code that exists on other platforms#endif
#ifdef H5 || MP-WEIXION
Code that exists on the H5 platform or WeChat Mini Program platform#endif

b. Nvue development on the App side

The uni-app App has a built-in native rendering engine based on Weex, which provides native rendering capabilities.

On the App side, if you use the vue page, use webview rendering; if you use the nvue page, use native rendering.

c. HTML5+

The uni-app App has a built-in HTML5+ engine, allowing js to directly call on rich native capabilities. Some more complex functions can be implemented by directly calling the App's native plug-ins. Can only be used on the App side, not on H5 and mini programs

Summarize

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

You may also be interested in:
  • An article to help you understand the basics of VUE
  • A brief talk about the knowledge you need to master when getting started with Vue
  • Summary of Vue component basics
  • A comprehensive review of Vue component introductory knowledge
  • Do you know the basic knowledge of Vue?

<<:  XHTML introductory tutorial: Use of list tags

>>:  How to use Docker to package and deploy images locally

Recommend

17 404 Pages You'll Want to Experience

How can we say that we should avoid 404? The reas...

Summary of HTML knowledge points for the front end (recommended)

1. HTML Overview htyper text markup language Hype...

Detailed explanation of script debugging mechanism in bash

Run the script in debug mode You can run the enti...

Example of CSS3 to achieve div sliding in and out from bottom to top

1. First, you need to use the target selector of ...

MySQL database import and export data error solution example explanation

Exporting Data Report an error SHOW VARIABLES LIK...

Solution to MySQLSyntaxErrorException when connecting to MySQL using bitronix

Solution to MySQLSyntaxErrorException when connec...

Full HTML of the upload form with image preview

The upload form with image preview function, the ...

The latest popular script Autojs source code sharing

Today I will share with you a source code contain...

mysql-5.7.28 installation tutorial in Linux

1. Download the Linux version from the official w...

MySQL variable principles and application examples

In the MySQL documentation, MySQL variables can b...

CSS shadow animation optimization tips

This technique comes from this article - How to a...

CSS pseudo-class: empty makes me shine (example code)

Anyone who has read my articles recently knows th...

How to create users and manage permissions in MySQL

1. How to create a user and password 1. Enter the...

Two ways to understand CSS priority

Method 1: Adding values Let's go to MDN to se...