Home WeChat Applet WeChat Development WeChat public account development weui usage experience

WeChat public account development weui usage experience

Mar 18, 2017 pm 06:01 PM

WeChat public account development weui usage experience to avoid making fewer mistakes!

Special note:

If you use jquery, jquery.js must be placed at the end of , otherwise weui will not work.

Quoting part of weui

You only need to load weui.css

{% load staticfiles %}
<link rel="stylesheet" href="{% static "joyroost/css/weui.css" %}"/>
Copy after login

Quoting the entire example framework of weui

head link css
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
    <title>WeUI</title>
    {% load staticfiles %}
    <link rel="stylesheet" href="{% static "joyroost/css/weui.css" %}"/>
    <link rel="stylesheet" href="{% static "joyroost/css/example.css" %}"/>
</head>
Copy after login

body Finally write js

<script src="{% static "joyroost/js/weui/zepto.min.js" %}"></script>
<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script src="https://res.wx.qq.com/open/libs/weuijs/1.0.0/weui.min.js"></script>
<script src="{% static "joyroost/js/weui/example.js" %}"></script>
Copy after login

weui structure

<script type="text/html" id="tpl_home">
<div class="page">
    <div class="page__hd">
    <div class="page__bd">
    <div class="page__ft">
Copy after login

Notes:

If id="tpl_home" is not written on the page, an error will be reported

<script type="text/html" id="tpl_home">
    <div class="page">
Copy after login

The error will be reported as follows:

Uncaught TypeError: Cannot set property &#39;url&#39; of undefined
at setPageManager (example.js:264)
at init (example.js:289)
at example.js:296
at HTMLDocument.<anonymous> (zepto.min.js:1)
Copy after login

The following is an error message in chromium:

 chromium 中报错图

from Jianshu swotpp

The above is the detailed content of WeChat public account development weui usage experience. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
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 Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)