【微信小程序】项目初始化

| var() CSS 函数可以插入一个自定义属性(有时也被称为"CSS 变量")的值,用来代替非自定义 属性中值的任何部分。

1.初始化样式与颜色

css 复制代码
view,text{
  box-sizing: border-box;
}
page{
  --themColor:#ad905c;
  --globalColor:#18191b;
  --focusColor:#4b4b4b;
  --descColor:#7f7f7f;
  --greyColor:#8f8f8f;
  --subColor:#b3b2b2;
  --lightColor:#e3e3e3;
  --globalBgColor1:#e3e3e5;
  --globalBgColor2:#f6f6f5;
  --globalBgColor3:#fdfdfc,
    }
css 复制代码
.title{
  color: var(--globalColor);
}

2.初始化app.json

创建主要的几个页面,创建tabBar,配置选中颜色

javascript 复制代码
{
  "pages":[
    "pages/index/index",
    "pages/classify/classify",
    "pages/news/news"
  ],
  "window":{
    "backgroundTextStyle":"dark",
    "navigationBarTitleText": "酒巷子",
    "navigationBarTextStyle":"white"
  },
  "style": "v2",
  "sitemapLocation": "sitemap.json",
  "tabBar": {
    "color": "#4b4b4b",
    "selectedColor": "#bda066",
    "list": [{
      "pagePath": "pages/index/index",
      "text": "首页",
      "iconPath": "/static/images/home.png",
      "selectedIconPath": "/static/images/home-fill.png"
    },{
      "pagePath": "pages/classify/classify",
      "text":"分类",
      "iconPath": "/static/images/all.png",
      "selectedIconPath": "/static/images/all-fill.png"
    },{
      "pagePath": "pages/news/news",
      "text": "资讯",
      "iconPath": "/static/images/news.png",
      "selectedIconPath": "/static/images/news-fill.png"
    }
  ]
  }
}

芜湖,初始化完成~

++1.创建自定义全局/局部组件:【微信小程序】创建自定义组件_进阶的CC的博客-CSDN博客++

++2.swiper的基本使用:++ 【微信小程序】swiper的使用_进阶的CC的博客-CSDN博客​​​​​​

3.srcoll-view的基本使用:【微信小程序】scroll-view的基本使用_进阶的CC的博客-CSDN博客

4.文章样式、全局样式、设置背景:https://blog.csdn.net/qq_57676486/article/details/132948300?csdn_share_tail=%7B%22type%22%3A%22blog%22%2C%22rType%22%3A%22article%22%2C%22rId%22%3A%22132948300%22%2C%22source%22%3A%22qq_57676486%22%7Dhttps://blog.csdn.net/qq_57676486/article/details/132948300?csdn_share_tail=%7B%22type%22%3A%22blog%22%2C%22rType%22%3A%22article%22%2C%22rId%22%3A%22132948300%22%2C%22source%22%3A%22qq_57676486%22%7D

相关推荐
zhanshuo10 分钟前
不依赖框架,如何用 JS 实现一个完整的前端路由系统
前端·javascript·html
火柴盒zhang11 分钟前
websheet在线电子表格(spreadsheet)在集团型企业财务报表中的应用
前端·html·报表·合并·spreadsheet·websheet·集团财务
khalil13 分钟前
基于 Vue3实现一款简历生成工具
前端·vue.js
拾光拾趣录20 分钟前
浏览器对队头阻塞问题的深度优化策略
前端·浏览器
用户81221993672221 分钟前
[已完结]后端开发必备高阶技能--自研企业级网关组件(Netty+Nacos+Disruptor)
前端
万少25 分钟前
2025中了 聊一聊程序员为什么都要做自己的产品
前端·harmonyos
abigale032 小时前
webpack+vite前端构建工具 -11实战中的配置技巧
前端·webpack·node.js
专注API从业者3 小时前
构建淘宝评论监控系统:API 接口开发与实时数据采集教程
大数据·前端·数据库·oracle
Joker`s smile3 小时前
Chrome安装老版本、不同版本,自制便携版本用于前端调试
前端·chrome
HERR_QQ3 小时前
【unify】unify的微信小程序开发学习 (to be continued)
学习·微信小程序·小程序