当前位置:网站首页>Applet directory structure

Applet directory structure

2022-07-07 14:26:00 InfoQ

Directory structure

null
  • pages: Under this directory is the page of the applet
  • utils: What is stored here is public js, Providing a common way to reduce redundancy and maintenance difficulty
  • app.js: The overall situation related to the whole wechat applet js, Here are the lifecycle functions and global variables that monitor the entire applet ;
  • app.json: It is the static global configuration of the entire applet , We can configure which pages the applet consists of in this file ( route ), Configure the window background color for the applet 、 Configure the navigation bar style , Configure the default title , You can configure the style of the whole project , Timeout time , Loaded plug-ins, etc ;( Note that no comments can be added to this file );
  • app.wxss file : The style file of the whole applet , For each page css The content of the file is different , Loaded into the corresponding page css style , Current page wxss The file will be overwritten app.wxss file ( It's estimated to be ordinary css The coverage rules of styles are similar ).
  • project.config.json file :  This is actually a project generated by every developer tool , But it is not particularly relevant to the project content , It mainly records the configuration of relevant tools , Any configuration made on the tool will be written to this file , When reinstalling tools or changing computers , 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 .
  • sitemap.json file :  This can be configured to allow Indexing by wechat , See wechat official documents for details -sitemap  To configure
In the project directory , The following files will be compiled , So you can't directly access :
.js、app.json、
.wxml、*.wxss( among  wxml  and  wxss  File only for  app.json  Page configured in ). besides , Only files with suffix in the white list can be uploaded , Files that are not in the white list can be accessed in the development tool , But it can't be uploaded . The specific white list is as follows :
  • wxs
  • png
  • jpg
  • jpeg
  • gif
  • svg
  • json
  • cer
  • mp3
  • aac
  • m4a
  • mp4
  • wav
  • ogg
  • silk
  • wasm
  • br
  • cert
原网站

版权声明
本文为[InfoQ]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/188/202207071232488942.html