search
HomeWeChat AppletMini Program DevelopmentMini program step by step: introduction, text, events, style

Mini program step by step: introduction, text, events, style

Feb 28, 2017 am 10:54 AM
Mini program development

Introduction to Mini Programs

The question of whether native APP or Web APP will be the mainstream in the future has been debated for many years. The biggest advantage of native APP is that its ability to call system control interfaces and frameworks is not as good as that of Web APP. Know where to go. Although JD.com provides both mobile APP and mobile H5 pages for users to browse and place orders, those who have used both at the same time can realize that the smoothness of H5 pages is still inferior.
Prior to this, many entrepreneurs completed the implantation of basic functions in WeChat by embedding H5 in the menu bar of official accounts, but these were usually relatively simple pages and the operating experience was relatively average.
The biggest highlight of the mini program launched by WeChat this time is that WeChat provides a wealth of framework components and API interfaces for developers to call, including: interface, view, content, button, navigation, multimedia, location, data, network , gravity induction, etc. With the help of these components and interfaces, mini programs built on WeChat can maintain the same experience as native APPs in terms of running capabilities and fluency.
Mini program registration

Mini programs, subscription accounts, service accounts, and enterprise accounts are now parallel systems, so if you need to use them, you need to register again.
Regarding how to register, please read the official document description, which will not be cumbersome here:
WeChat Mini Program Access Guide
Development Tools

Download from the official website here:
WeChat Mini Program Development tool download address
Okay, the development tool download is complete, and you can start the instance directly after installation.
Introduction to development tools

1. Scan the QR code to log in (you need to register the WeChat applet first)

小程序循序渐进: 简 介、文本、事件、样式

2. Local applet project

小程序循序渐进: 简 介、文本、事件、样式

3. Add a project, just click "No APPID" here

小程序循序渐进: 简 介、文本、事件、样式

4. Okay, you can start coding.
Project directory structure

小程序循序渐进: 简 介、文本、事件、样式

#This directory is automatically generated by just checking the quick start project.

pages folder - contains all page files.

utils folder - contains some js tool sets.

app.js-Startup entry file.

app.wxss - global style sheet file.

app.json - global configuration file.

The .js suffix is ​​a script file, the .json suffix is ​​a configuration file, the .wxss suffix is ​​a style sheet file similar to .css, and the .wxml structure file is similar to .html
Take a look app.json

小程序循序渐进: 简 介、文本、事件、样式

#You can see that the pages project is allocated with the page path and entrance. By default, the first path is used as the entry.
pages/index/index, this project omits the .wxml suffix.
Each page will generate a directory, and each directory has four files by default.
Example

Example 1: Output text

Open index.wxml

小程序循序渐进: 简 介、文本、事件、样式

view is equivalent to a div in html.

image is a picture.

text is text.

Add text code:

小程序循序渐进: 简 介、文本、事件、样式

Effect:

小程序循序渐进: 简 介、文本、事件、样式

Example 2: Modify text Color

Add class

小程序循序渐进: 简 介、文本、事件、样式

小程序循序渐进: 简 介、文本、事件、样式

小程序循序渐进: 简 介、文本、事件、样式

小程序循序渐进: 简 介、文本、事件、样式


##More mini programs step by step: introduction, text, events , style-related articles please pay attention to the PHP Chinese website!


Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools