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

About MySQL innodb_autoinc_lock_mode

The innodb_autoinc_lock_mode parameter controls t...

js to achieve star flash effects

This article example shares the specific code of ...

Examples of using the or statement in MySQL

1. The use of or syntax in MySQL, and the points ...

Solution to define the minimum height of span has no effect

The span tag is often used when making HTML web pa...

Problems and solutions for MYSQL5.7.17 connection failure under MAC

The problem that MYSQL5.7.17 cannot connect under...

Vue+axios sample code for uploading pictures and recognizing faces

Table of contents Axios Request Qs processing dat...

SQL implementation of LeetCode (196. Delete duplicate mailboxes)

[LeetCode] 196.Delete Duplicate Emails Write a SQ...

Introduction to the use of html base tag target=_parent

The <base> tag specifies the default address...

MySQL 5.7.17 winx64 installation and configuration tutorial

Today I installed the MySQL database on my comput...

Implementation example of JS native double-column shuttle selection box

Table of contents When to use Structural branches...

Linux implements automatic and scheduled backup of MySQL database every day

Overview Backup is the basis of disaster recovery...

Summary of 7 pitfalls when using react

Table of contents 1. Component bloat 2. Change th...