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

Docker primary network port mapping configuration

Port Mapping Before the Docker container is start...

Vue template configuration and webstorm code format specification settings

Table of contents 1. Compiler code format specifi...

MySQL fuzzy query usage (regular, wildcard, built-in function)

Table of contents 1. MySQL wildcard fuzzy query (...

MySQL transaction details

Table of contents Introduction Four characteristi...

3 methods to restore table structure from frm file in mysql [recommended]

When mysql is running normally, it is not difficu...

Teach you to quickly build a web cluster project based on nginx

Table of contents 1. Project Environment 2. Proje...

How to implement h5 input box prompt + normal text box prompt

XML/HTML CodeCopy content to clipboard < input...

JavaScript web form function communication full of practical information

1. Introduction Earlier we talked about the front...

Solution to define the minimum height of span has no effect

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

iframe src assignment problem (server side)

I encountered this problem today. I reassigned the...

CSS realizes the realization of background image screen adaptation

When making a homepage such as a login page, you ...

Simple use of Vue bus

Simple use of Vue bus Scenario description: Compo...

Summary of CSS gradient effects (linear-gradient and radial-gradient)

Linear-gradient background-image: linear-gradient...