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

Implementing simple chat room dialogue based on websocket

This article shares the specific code for impleme...

50 Super Handy Tools for Web Designers

Being a web designer is not easy. Not only do you...

Detailed explanation of JavaScript's built-in objects Math and strings

Table of contents Math Objects Common properties ...

Detailed steps for configuring virtual hosts in nginx

Virtual hosts use special software and hardware t...

Share 20 excellent web form design cases

Sophie Hardach Clyde Quay Wharf 37 East Soapbox Rx...

Native JS to implement paging click control

This is an interview question, which requires the...

The whole process of implementing the summary pop-up window with Vue+Element UI

Scenario: An inspection document has n inspection...

js to achieve waterfall flow layout (infinite loading)

This article example shares the specific code of ...

An IE crash bug

Copy code The code is as follows: <style type=...

Solution to no Chinese input method in Ubuntu

There is no solution for Chinese input method und...

Solution to the problem that Docker container cannot access Jupyter

In this project, the Docker container is used to ...