day09小程序复习

一、公共文件

小程序包含一个描述整体程序的app和多个page文件。

全局的app.json文件,里面不能是空的,至少的配置属性

  {"pages":[

         "pages/about/about"

  ]}

about.json:Page({})

二、基本组件

属性:style、bindtap、hidden=“true/false”、data-user-name="user" 自定义属性

弹性盒子布局:整体布局,灵活

view{
  background-color: #eee;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content:space-around;
  align-items: center;
}

三、响应式长度rpx    1rpx=0.5px   响应式布局,不管什么屏幕,都可以占屏幕的一半

四、页面跳转

  使用navigator组件:使用navigator组件-从about页跳转到weekly页

  open-type属性

  hover-class属性,及使用时注意之处

<view class="container">
<image src="/images/film.jpg" class="about-banner"></image>
<text class="text1">电影周围看</text>
<view>
  <text>我</text>
  <navigator style="display:inline;" url="/pages/weekly/weekly" open-type="navigate" hover-class="nav-hover" class="nav-default">每周推荐
  </navigator>
  <text>一部好片</text>
</view>
<text class="text3">我的微博:weibo.com/simbasong</text>
</view>

五、配置tabBar

配置tabBar-对若干一级页面的入口链接

全局配置app.json,里面的data属性,可以写一些默认的数据信息

 

posted @ 2020-07-12 18:22  等风者  阅读(157)  评论(0编辑  收藏  举报