
微信小程序
隔壁阿源
先证明你的价值,再来讨论你的雄心壮志。
展开
-
微信小程序(一)
app.json配置{ "pages":[ "pages/index/index", "pages/test/test" ], "window":{ "backgroundTextStyle":"light", "navigationBarBackgroundColor": "#fff", "navigationBarTitleText": "...原创 2019-04-21 14:34:01 · 270 阅读 · 0 评论 -
微信小程序(二)
点击事件在控件上使用bindtap绑定事件<text class="text-top text" style='color:{{color}}' data-name='自定义属性' id='mytext' bindtap='clickMe'>{{motto}}</text>clickMe:function(event){ console.log(event)...原创 2019-04-21 15:11:51 · 174 阅读 · 0 评论 -
微信小程序(三)
列表渲染默认索引是index,默认对象是item,下面是自定义索引和对象。 wx:for适用于view和block,使用block时仅仅是将数据循环打印出来,不会一个对象有一个标签,而view是会有一个对象一个标签。wxml<view wx:for="{{users}}" wx:for-index="num" wx:for-item="user"> {{num}}:...原创 2019-04-21 20:57:00 · 215 阅读 · 0 评论 -
微信小程序(四)
wxs每个wxs都是一个独立的模块,类似于一个js文件。需要通过module.exports向外暴露。可以在别的wxs文件或者wxml文件中引入var name = "ay";var age = "18";var method = function(obj){ return obj;}module.exports = { name: name, age: age, m...原创 2019-04-22 16:47:49 · 143 阅读 · 0 评论 -
微信小程序(五)
flex布局弹性布局。display:flex表示使用flex布局,主要有下面几个属性flex-direction,flex-wrap,justify-content。在flex容器中的元素,会按order进行排序展示,值越小越先展示,flex是占比,设置了flex则元素的width就相当于失效了。元素宽度等于flex占屏幕宽度的比例。这几个属性会相互作用,比如指定了逆向,再指定order。...原创 2019-04-22 17:33:38 · 276 阅读 · 0 评论 -
微信小程序(六)
scroll-view常用的属性bindscrolltoupper和bindscrolltolower,这两个属性是指当滚动到距离顶部或底部一定距离时触发事件,距离由lower-threshold和upper-threshold确定。可以用于分页加载数据。其他属性enable-back-to-top=‘true’,是指安卓或ios中点击小程序标题栏时,自动列表滚动到顶部。scroll-wit...原创 2019-04-22 21:12:25 · 700 阅读 · 0 评论 -
微信小程序(七)
button主要属性size(默认宽度100%),type(样式),plain(镂空),loading(在跟后台交互的时候可以显示),form-type(submit/reset,提交表单或重置表单)<button>按钮</button><button size='mini'>按钮</button><button size='mini'...原创 2019-04-23 21:52:16 · 315 阅读 · 0 评论 -
微信小程序(八)
inputinput有许多属性。value 输入框的初始内容type有这几个选项text 文本输入键盘 number 数字输入键盘 idcard 身份证输入键盘 digit 带小数点的数字键盘,调用手机输入键盘password = ‘{{true}}’ 是否是密码类型placeholder = ‘提示’ 当input无内容时提示用户输入disabled = ‘{{false}}’ 禁用...原创 2019-04-24 19:18:32 · 401 阅读 · 0 评论