前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >微信小程序 Helloworld

微信小程序 Helloworld

作者头像
用户5760343
发布2020-01-15 16:09:48
4230
发布2020-01-15 16:09:48
举报
文章被收录于专栏:sktjsktjsktj

image.png

快捷键

image.png

image.png

js 逻辑 json 配置 wxss 样式 wxml 结构文件

navigationBarTitleText窗口标题 backgroundColor 背景色

image.png

enablePullDownRefresh 下拉刷新

image.png

tabBar

image.png

控制超时时间

image.png

页面配置文件

image.png

小程序生命周期APP

onLaunch 当小程序初始化完 onShow 小程序启动 onHide

Page生命周期

onLoad: 页面加载完,一个页面调用一次,可以获取wx.navigateTo 和wx.redirectTo 和 query onShow onReady 初次渲染完 onHide onUnload onPullDownRefresh 下拉刷新

全局的数据在app.js中可以设置

globalData:{ userInfo:null }

页面中的数据设置

Page({ data: { motto: '呵呵', userInfo: {}, hasUserInfo: false, canIUse: wx.canIUse('button.open-type.getUserInfo') },

绑定事件

image.png

动态设置数据

this.setData({ userInfo:userInfo })

view,image,text

image.png

判断

wx:if="{{length > 2}}" wx:else

image.png

<block wx:if=""

image.png

wx:for="{{}}" 循环

image.png

{{index}} {{item.name}}

重命名下标

image.png

for 1到10

image.png

block

image.png

使用模板

image.png

template

导入其他页面

<import src="template.wxml" />

image.png

原原本本导入其他页面include

image.png

事件类型

冒泡事件:touchstart,touchmove,touchcancel,touchend,tap,longtap 非冒泡事件:submit,input, scroll

事件绑定:bindtap

image.png

事件对象event属性

type timeStamp target

image.png

touches

image.png

detail

wxss

rpx,rem

image.png

@import "common.wxss"

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 快捷键
  • tabBar
  • 控制超时时间
  • 页面配置文件
  • 小程序生命周期APP
  • Page生命周期
  • 全局的数据在app.js中可以设置
  • 页面中的数据设置
  • 绑定事件
  • 动态设置数据
  • 判断
  • 重命名下标
  • for 1到10
  • block
  • 使用模板
  • 导入其他页面
  • 原原本本导入其他页面include
  • 事件类型
  • 事件绑定:bindtap
  • 事件对象event属性
  • wxss
相关产品与服务
云开发 CloudBase
云开发(Tencent CloudBase,TCB)是腾讯云提供的云原生一体化开发环境和工具平台,为200万+企业和开发者提供高可用、自动弹性扩缩的后端云服务,可用于云端一体化开发多种端应用(小程序、公众号、Web 应用等),避免了应用开发过程中繁琐的服务器搭建及运维,开发者可以专注于业务逻辑的实现,开发门槛更低,效率更高。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档