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

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
Mandragora: Whispers Of The Witch Tree - How To Unlock The Grappling Hook
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Clair Obscur: Expedition 33 - How To Get Perfect Chroma Catalysts
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools