A brief discussion on VUE uni-app conditional coding and page layout

A brief discussion on VUE uni-app conditional coding and page layout

Conditional compilation

Conditional compilation uses special comments as markers. During compilation, the code in the comments is compiled to different platforms based on these special comments.

Writing method: Start with #ifdef or #ifndef plus %PLATFORM% and end with #endif.

#ifdef : if defined only exists on certain platforms

#ifndef :if not defined exists on all platforms except certain ones

%PLATFORM% : Platform name

Page Layout

scss specification, rpx width in iPhone6/7/8 is 750, 2rpx = 1px

<style lang="scss">
	@import "./news.css"; // Load other css files .f1{
		font-size: 50rpx;
		.c3{
			background-color: red;
		}
	}
</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:
  • A brief discussion on VUE uni-app's commonly used APIs
  • A brief discussion on VUE uni-app custom components
  • A brief introduction to VUE uni-app basic components
  • A brief discussion on VUE uni-app template syntax
  • A brief discussion on the VUE uni-app development environment
  • A brief introduction to VUE uni-app core knowledge
  • A brief discussion on the VUE uni-app life cycle

<<:  Linux steps to configure local yum source, configure domestic yum source, and configure epel source

>>:  HTML table markup tutorial (43): VALIGN attribute of the table header

Recommend

Detailed explanation of Javascript string methods

Table of contents String length: length charAt() ...

Introduction and tips for using the interactive visualization JS library gojs

Table of contents 1. Introduction to gojs 2. Gojs...

Solution to the error when calling yum in docker container

When executing yum in dockerfile or in the contai...

How to view and close background running programs in Linux

1. Run the .sh file You can run it directly using...

Some issues we should pay attention to when designing a web page

Web design, according to personal preferences and ...

mysql error number 1129 solution

SQLyog connects to mysql error number 1129: mysql...

Build a severe weather real-time warning system with Node.JS

Table of contents Preface: Step 1: Find the free ...

Flex layout realizes the layout mode of upper and lower fixed and middle sliding

This article mainly introduces the layout method ...

Vue component to realize carousel animation

This article example shares the specific code of ...

MySQL database migration quickly exports and imports large amounts of data

Database migration is a problem we often encounte...

Implementation of navigation bar and drop-down menu in CSS

1. CSS Navigation Bar (1) Function of the navigat...

Introduction to Linux compression and decompression commands

Table of contents Common compression formats: gz ...

Usage and demonstration of ref in Vue

ref definition: used to register reference inform...

Understanding JavaScript prototype chain

Table of contents 1. Understanding the Equality R...