当前位置:网站首页>Wechat applet learning notes 1
Wechat applet learning notes 1
2022-07-26 09:50:00 【~ light boat ~】
Wechat applet :QuickStart
One 、 .json Suffix JSON The configuration file
.json Sub applet configuration app.json、 Tool configuration project.config.json And page configuration page.json Let's talk about :
1、app.json
app.json Is the global configuration of the current applet , Including the page path of the applet (pages)、 Interface performance window、 Network timeout networkTimeout、 Bottom tab etc.
pages Accept an array , Each item is a string , Specify which pages the applet consists of . Each item represents the path of the corresponding page + file name
window: Set applet status bar 、 Navigation bar 、 title 、 Window background color .
{
"window":{ "navigationBarBackgroundColor": "#ffffff", "navigationBarTextStyle": "black", "navigationBarTitleText": " Wechat interface function demonstration ", "backgroundColor": "#eeeeee", "backgroundTextStyle": "light" } }
tabBar Bottom or top of client window tab Bar for switching pages
Pay attention here : When setting position by top Will not display icon tabBar in list Is an array , discharge 2-5 individual
networkTimeout Set the timeout of various network requests
2、page.json
page.json Every page can use , Configure the window on this page . Priority is higher than app.json high , Will be covered app.json The same setting item in
Page .json Only... Can be set window Related configuration items , So there is no need to write window This key
{
"navigationBarBackgroundColor": "#ffffff",
"navigationBarTextStyle": "black",
"navigationBarTitleText": " Wechat interface function demonstration ",
"backgroundColor": "#eeeeee",
"backgroundTextStyle": "light" }
3、project.comfig.json
This is mainly to do some personalized configuration according to their preferences , Such as interface color 、 Compile configuration, etc , When you change the computer and reinstall the tool, you need to reconfigure
therefore
With that in mind , The applet developer tool generates a project.config.json, Any configuration you make on the tool will be written to this file , When you re install tools or change your computer to work , You just load the code package of the same project , The developer tool will automatically help you recover to the personalized configuration when you developed the project , It will include the editor's color 、 A series of options such as automatic compression when uploading code .
It can be used in the project root directory project.config.json File to configure the project
{
"miniprogramRoot": "./src",
"qcloudRoot": "./svr",
"setting": {
"postcss": true,
"es6": true,
"minified": true,
"urlCheck": false
}
}
Two 、WXML Template
Web programming HTML+CSS+JS,HLML It is used to describe the current page structure ,CSS Describe what the page looks like ,JS Handle the interaction between pages and users ,WXML similar HTML
The difference is :html Frequently used div,p,span . Different tags combine different components ,wxml Package commonly used components , Common labels view,button,text etc.
3、 ... and 、WXSS style
similar CSS
Four 、JS Interaction
The latter two things will be talked about slowly
边栏推荐
- PHP one-time request lifecycle
- M-ary number STR to n-ary number
- POJ 1012 Joseph
- [information system project manager] summary of essence of high-level series for the first time
- Process32first returns false, error x message 24
- 服务器、客户端双认证
- Mo team learning notes (I)
- 云原生(三十六) | Kubernetes篇之Harbor入门和安装
- 电机转速模糊pid控制
- antd TreeSelect获取父节点的值
猜你喜欢
2022年中科磐云——服务器内部信息获取 解析flag
图解用户登录验证流程,写得太好了!
服务器、客户端双认证(2)
Fiddler packet capturing tool for mobile packet capturing
Docker configuring MySQL Cluster
B站这个视频我是跪着看完的
AR model in MATLAB for short-term traffic flow prediction
Fuzzy PID control of motor speed
Search module use case writing
2019 ICPC Asia Yinchuan Regional(水题题解)
随机推荐
网站设计需要的基本知识
服务器、客户端双认证
Show default image when wechat applet image cannot be displayed
系统安装Serv-U后IIS出错提示:HRESULT:0x80070020
解决ProxyError: Conda cannot proceed due to an error in your proxy configuration.
Flutter Event 派发
服务发现原理分析与源码解读
IIS website configuration
2021 windows penetration of "Cyberspace Security" B module of Shandong secondary vocational group (analysis)
解决npm -v突然失效 无反应
Audio and video knowledge
2019 ICPC Asia Yinchuan Regional(水题题解)
Xiaobai makes a wave of deep copy and shallow copy
在Blazor 中自定义权限验证
JS one line code to obtain the maximum and minimum values of the array
(二)面扫描仪与机械臂的手眼标定(眼在手外:九点标定)
Flutter event distribution
E. Two Small Strings
Spolicy request case
Phpexcel export Emoji symbol error