Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Case Analysis of javascript Mini Program configuration

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)05/31 Report--

This article introduces the relevant knowledge of "case Analysis of javascript Mini Program configuration". Many people will encounter such a dilemma in the operation of actual cases, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

1 、 app.json

These basic configurations can satisfy normal development, while others, such as request request timeout, can be used by default.

{

"pages": [

"pages/index/index", / / all pages need to be defined in this module, otherwise they cannot be displayed

"pages/logs/logs"

]

"window": {/ / some global configurations

"backgroundTextStyle": "white"

"navigationBarBackgroundColor": "# fff", / / Top navigation bar color

"navigationBarTitleText": "Momo and Dust", / / text at the top

"navigationBarTextStyle": "black" / / text style, which supports white | black

}

"tabBar": {/ / tab tab

"list": [

{

"iconPath": "imgs/icon/icon-home.png", / / unchecked status picture address

"selectedIconPath": "imgs/icon/icon-home-selected.png", the address of the picture when selected

"pagePath": "pages/index/index", / / page

"text": "Home Page" / / text display

}

{

"iconPath": "imgs/icon/icon-usercenter.png"

"selectedIconPath": "imgs/icon/icon-usercenter-selected.png"

"pagePath": "pages/logs/logs"

"text": "mine"

}

]

"color": "# 000", / / default text color

"selectedColor": "# fff", / / text color when selected

"backgroundColor": "# e04443", / / default tab background

"borderStyle": "white"

"position": "bottom" / / location, which supports bottom | top

}

}

2. Other json

Each corresponding wxml has its own corresponding json, which can also be configured as above and will overwrite the global app.json file configuration.

3 、 wxss

An external style sheet (wa-ui) is referenced as follows:

@ import 'wa-ui.wxss'

Just introduce it in the global app.wxss, and other pages can use its style.

4 、 JS

Mini Program's js is different from ordinary js, can not use objects such as window, document, and therefore can not use frameworks such as jquery. The js of Mini Program is written a bit like VUE, as follows:

This is the end of the content of "javascript Mini Program configuration case Analysis". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report