ylbtech-小程序-demo:小程序示例-page/component

以下将展示小程序官方组件能力,组件样式仅供参考,开发者可根据自身需求自定义组件样式,具体属性参数详见小程序开发文档。

1. page/component返回顶部
1、
a) .js
  1. Page({
  2. data: {
  3. list: [
  4. {
  5. id: 'view',
  6. name: '视图容器',
  7. open: false,
  8. pages: ['view', 'scroll-view', 'swiper']
  9. }, {
  10. id: 'content',
  11. name: '基础内容',
  12. open: false,
  13. pages: ['text', 'icon', 'progress']
  14. }, {
  15. id: 'form',
  16. name: '表单组件',
  17. open: false,
  18. pages: ['button', 'checkbox', 'form', 'input', 'label', 'picker', 'radio', 'slider', 'switch', 'textarea']
  19. }, {
  20. id: 'nav',
  21. name: '导航',
  22. open: false,
  23. pages: ['navigator']
  24. }, {
  25. id: 'media',
  26. name: '媒体组件',
  27. open: false,
  28. pages: ['image', 'audio', 'video']
  29. }, {
  30. id: 'map',
  31. name: '地图',
  32. pages: ['map']
  33. }, {
  34. id: 'canvas',
  35. name: '画布',
  36. pages: ['canvas']
  37. }
  38. ]
  39. },
  40. kindToggle: function (e) {
  41. var id = e.currentTarget.id, list = this.data.list;
  42. for (var i = 0, len = list.length; i < len; ++i) {
  43. if (list[i].id == id) {
  44. list[i].open = !list[i].open
  45. } else {
  46. list[i].open = false
  47. }
  48. }
  49. this.setData({
  50. list: list
  51. });
  52. }
  53. })
b) .json
  1. {
  2. "navigationBarTitleText": "小程序官方组件展示"
  3. }
c) .wxml
  1. <view class="index">
  2. <view class="index-hd">
  3. <image class="index-logo" src="resources/kind/logo.png"></image>
  4. <view class="index-desc">以下将展示小程序官方组件能力,组件样式仅供参考,开发者可根据自身需求自定义组件样式,具体属性参数详见小程序开发文档。</view>
  5. </view>
  6. <view class="index-bd">
  7. <view class="kind-list">
  8. <block wx:for-items="{{list}}" wx:key="{{item.id}}">
  9. <view class="kind-list-item">
  10. <view id="{{item.id}}" class="kind-list-item-hd {{item.open ? 'kind-list-item-hd-show' : ''}}" bindtap="kindToggle">
  11. <view class="kind-list-text">{{item.name}}</view>
  12. <image class="kind-list-img" src="resources/kind/{{item.id}}.png"></image>
  13. </view>
  14. <view class="kind-list-item-bd {{item.open ? 'kind-list-item-bd-show' : ''}}">
  15. <view class="navigator-box {{item.open ? 'navigator-box-show' : ''}}">
  16. <block wx:for-items="{{item.pages}}" wx:for-item="page" wx:key="*item">
  17. <navigator url="pages/{{page}}/{{page}}" class="navigator">
  18. <view class="navigator-text">{{page}}</view>
  19. <view class="navigator-arrow"></view>
  20. </navigator>
  21. </block>
  22. </view>
  23. </view>
  24. </view>
  25. </block>
  26. </view>
  27. </view>
  28. </view>
d) .wxss
  1. @import "../common/index.wxss";
e)
2、pages
3、resources
-kind
-pic
4、
2.  ./pages/view 试图容器返回顶部
1、view
a) .js
b) .json
c) .wxml
d) .wxss
e)
2、scroll-view
a) .js
b) .json
c) .wxml
d) .wxss
e)
3、swiper
a) .js
b) .json
c) .wxml
d) .wxss
e)
4、
3. ./pages/content 基础内容返回顶部
1、text
a) .js
b) .json
c) .wxml
d) .wxss
e)
2、icon
a) .js
b) .json
c) .wxml
d) .wxss
e)
3、progress
a) .js
b) .json
c) .wxml
d) .wxss
e)
4. ./pages/form 表单组件返回顶部
1、button
a) .js
b) .json
c) .wxml
d) .wxss
e)
2、checkbox
a) .js
b) .json
c) .wxml
d) .wxss
e)
3、form
a) .js
b) .json
c) .wxml
d) .wxss
e)
4、input
a) .js
b) .json
c) .wxml
d) .wxss
e)
5、label
a) .js
b) .json
c) .wxml
d) .wxss
e)
6、picker
1、view
a) .js
b) .json
c) .wxml
d) .wxss
e)
7、radio
a) .js
b) .json
c) .wxml
d) .wxss
e)
8、slider
a) .js
b) .json
c) .wxml
d) .wxss
e)
9、switch
a) .js
b) .json
c) .wxml
d) .wxss
e)
10、textarea
a) .js
b) .json
c) .wxml
d) .wxss
e)
11、
5. ./pages/nav 导航返回顶部
1、navigator
a) .js
b) .json
c) .wxml
d) .wxss
e)
2、
 
6. ./pages/media 媒体组件返回顶部
1、image
a) .js
b) .json
c) .wxml
d) .wxss
e)
2、audio
a) .js
b) .json
c) .wxml
d) .wxss
e)
3、video
a) .js
b) .json
c) .wxml
d) .wxss
e)
4、
7. ./pages/map 地图返回顶部
1、map
a) .js
b) .json
c) .wxml
d) .wxss
e)
2、
8. ./pages/canvas 画布返回顶部
1、canvas
a) .js
b) .json
c) .wxml
d) .wxss
e)
2、
9.返回顶部
 
10.返回顶部
 
 
11.返回顶部
 
作者:ylbtech
出处:http://ylbtech.cnblogs.com/
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。

小程序-demo:小程序示例-page/component的更多相关文章

  1. 近期热门微信小程序demo源码下载汇总

    近期微信小程序demo源码下载汇总,乃小程序学习分析必备素材!点击标题即可下载: 即速应用首发!原创!电商商场Demo 优质微信小程序推荐 -秀人美女图 图片下载.滑动翻页 微信小程序 - 新词 GE ...

  2. 小程序-demo:小程序示例-page/api

    ylbtech-小程序-demo:小程序示例-page/api 以下将演示小程序接口能力,具体属性参数详见小程序开发文档. 1. page/component返回顶部 1. a) .js Page({ ...

  3. 小程序-demo:小程序示例-page/component2

    ylbtech-小程序-demo:小程序示例-page/component2 以下将展示小程序官方组件能力,组件样式仅供参考,开发者可根据自身需求自定义组件样式,具体属性参数详见小程序开发文档. 1. ...

  4. 小程序-demo:小程序示例-page/common

    ylbtech-小程序-demo:小程序示例-page/common 1.返回顶部 0.     1. 2. pages/common返回顶部 1. -lib --weui.wxss /*! * we ...

  5. 小程序-demo:小程序示例

    ylbtech-小程序-demo:小程序示例     1.返回顶部 0. 1.app.js const openIdUrl = require('./config').openIdUrl App({ ...

  6. 小程序-demo:知乎日报

    ylbtech-小程序-demo:知乎日报 1.返回顶部 0.         1.app.js //app.js App({ onLaunch: function () { //调用API从本地缓存 ...

  7. 小程序-demo:小熊の日记

    ylbtech-小程序-demo:小熊の日记 1.CHANGELOG.md # -- * 更新开发者工具至`v0.10.101100` * 修改`new`页的数据绑定方式 & 修改多行文本框输 ...

  8. 小程序-demo:天气预报

    ylbtech-小程序-demo:天气预报 1.返回顶部 1.app.js //app.js App({ //系统事件 onLaunch: function () {//小程序初始化事件 var th ...

  9. 番外篇!全球首个微信应用号开发教程!小程序 DEMO 视频奉上!

    大家好,我是博卡君.经过国庆节的七天假期,相信很多朋友都已经研究出自己的小程序 demo 了吧?我最近也利用休息时间关注了一下网上关于小程序开发的讨论,今天就利用这个番外篇谈谈自己对小程序的一些想法吧 ...

随机推荐

  1. BZOJ4552 - [TJOI2016]排序

    Portal Description 给出一个\(1..n(n\leq10^5)\)的排列,进行\(m(m\leq10^5)\)次操作: 升序排列\([L,R]\)中的数. 降序排列\([L,R]\) ...

  2. 【DFS+剪枝】Square

    https://www.bnuoj.com/v3/contest_show.php?cid=9154#problem/J [题意] 给定n个木棍,问这些木棍能否围成一个正方形 [Accepted] # ...

  3. 如何打开Oracle的dmp文件

    在工作中经常使用到别人提供过来的dmp文件,由于不知道备份时所用的用户名,这样就不能恢复. 通过打开DMP文件可以查看到备份时使用的用户名. 1.如果dmp文件比较小,用文本编辑器打开就可以了. 2. ...

  4. ORACLE金额转换成英文大写的函数

    用法如下:get_capital_money(Currency, Money) Currency: 货币或货币描述,将放在英文大写的前面: Money:金额.支持两位小数点.如果需要更多的小数点,请自 ...

  5. Codeforces Round #294 (Div. 2) D. A and B and Interesting Substrings [dp 前缀和 ]

    传送门 D. A and B and Interesting Substrings time limit per test 2 seconds memory limit per test 256 me ...

  6. Tomcat错误信息(服务器版本号)泄露(低危)

    一.问题描述Tomcat报错页面泄漏Apache Tomcat/7.0.52相关版本号信息,是攻击者攻击的途径之一.因此实际当中建议去掉版本号信息. 二.解决办法 1.进入到tomcat/lib目录下 ...

  7. C++:vector中的resize()函数 VS reserve()函数

    http://www.cnblogs.com/biyeymyhjob/archive/2013/05/11/3072893.html

  8. Promise编程规范

    参考: http://www.cnblogs.com/dojo-lzz/p/4340897.html 闲话promise机制  http://www.cnblogs.com/lvdabao/p/es6 ...

  9. CentOS 更改Apache默认网站目录

    http://www.osyunwei.com/archives/789.html引言:Apache默认的网站目录是在/var/www/html, 现在要把网站目录更改到/home/wwwroot/w ...

  10. 盘点UML中的四种关系

    生活中,我们既是独立的个体,又通过联系形成各种关系,比方说:朋友.恋人.父子,同学--于是乎,出现了神乎其神的六人定律. 那么在UML中又存在什么样的关系呢?以下我们来梳理一下. 关联(Associa ...