WeChat public account development weui usage experience
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" %}"/>
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>
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>
weui structure
<script type="text/html" id="tpl_home"> <div class="page"> <div class="page__hd"> <div class="page__bd"> <div class="page__ft">
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">
The error will be reported as follows:
Uncaught TypeError: Cannot set property 'url' of undefined at setPageManager (example.js:264) at init (example.js:289) at example.js:296 at HTMLDocument.<anonymous> (zepto.min.js:1)
The following is an error message in 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!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

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

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)
