微信小程序结构

项目解释备注
ML结构标记语言
ss样式表Style Sheets
js逻辑主语言
json配置Object Notation 对象简谱

navigationBar 导航栏

//app.json
{
  "pages":[
    "page/convenience/convenience",
    "pages/order/order",
    "pages/my/my"
  ],
  "window":{
    "backgroundTextStyle":"dark",
    "navigationBarBackgroundColor": "#0094ff",
    "navigationBarTitleText": "便利墙",
    "navigationBarTextStyle":"white",
    "enablePullDownRefresh": true,
    "backgroundColor": "#0094ff"
  },

  "style": "v2",
  "sitemapLocation": "sitemap.json"
}

字符串,数字,对象

text不换行,view换行

ml
<text>{{ShouHouDiZhi}}</text>
<view>{{WenTiFanKui}}</view>
<view>{{YiWan}}</view>
<view>{{person.name}}</view>

<view id="item-{{id}}"> </view>
js
Page({
  data: {
    ShouHouDiZhi:"收货地址",
    WenTiFanKui:"问题反馈",
    YiWan:10000,
    person:{
      age:18,
      height:150,
      weight:45,
      name:"小玉"
    },
    id: 0
    }
    })
复选框
<view>
  <text>签收状态:</text>
  <checkbox checked="{{false}}"></checkbox>
</view>
三元
<view hidden="{{flag ? true : false}}"> Hidden </view>

<view>
  <view 
  wx:key="id"
  wx:for="{{list}}"
  wx:for-item="item"
  wx:for-index="index">
    {{index}}--{{item.name}}
  </view>
</view>

<view>
  <block
  wx:key="id"
  wx:for="{{list}}"
  wx:for-item="item"
  wx:for-index="index">
    {{index}}--{{item.name}}
  </block>
</view>

<view>
  <view 
  wx:key="age"
  wx:for="{{person}}"
  wx:for-item="value"
  wx:for-index="key">
  {{key}} {{value}}
  </view>
</view>

<view>
  <view></view>
  <view wx:if="{{true}}">显示</view>
  <view wx:if="{{false}}">隐藏</view>


  <view wx:if="{{false}}">1</view>
  <view wx:elif="{{false}}">2</view>
  <view wx:else>3</view>
</view>
<view hidden>hidden1</view>
<view hidden="{{false}}">频繁</view>

<view wx:if="{{true}}"> wx:if </view>
<view hidden>hidden</view>
<view hidden style="display:flex;">display覆盖</view>
Page({
  data: {

    QianShouZhuangTai:"签收状态:",
    NoYiQianShou:false,
    YesYiQianShou:true,
    list:[
      {
        id:0,
        name:"小0"

      },
      {
        id:1,
        name:"小1"
      },
      {
        id:2,
        name:"小2"
      }


    ]
  }
})
改page名称
page json "navigationBarTitleText": "便利墙",
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值