微信小程序开发实例详解
微信(小程序)  /  管理员 发布于 3年前   141
“小程序”破解IDE + Demo:https://github.com/gavinkwoe/weapp-ide-crack.git
资源汇总:https://github.com/Aufree/awesome-wechat-weapp
官方简易教程・MINA:http://wxopen.notedown.cn/
Hello小程序 - 非官方:http://www.helloxcx.com
微信应用号开发教程:https://my.oschina.net/wwnick/blog/750055
资源来自网络,拿走不谢!
简单搞了一下,吼吼~:
js:业务处理
//index.js//获取应用实例var app = getApp()Page({ data: { motto: 'Hello World', userInfo: {name:'汗青', desc:"前端的春天来了!\n 前端要烂大街了!!", avatarUrl:"http://img2.3lian.com/2014/gif/10/9/25.jpg"} }, //事件处理函数 bindViewTap: function() { wx.navigateTo({ url: '../logs/logs' }) }, onLoad: function () { console.log('onLoad') var that = this //调用应用实例的方法获取全局数据 app.getUserInfo(function(userInfo){ //更新数据 that.setData({ userInfo:userInfo }) that.update() }) }})
wxml:创建布局
<!--index.wxml--><view class="container"> <view bindtap="bindViewTap" class="userinfo"> <image class="userinfo-avatar" src="//article/{{userInfo.avatarUrl}}" background-size="cover"></image> <text class="userinfo-name">{{userInfo.name}}</text> <text class="userinfo-desc">{{userInfo.desc}}</text> </view> <view class="usermotto"> <text class="user-motto">{{motto}}</text> </view></view>
wxss:设置样式
/**index.wxss**/.userinfo { display: flex; flex-direction: column; align-items: center;}.userinfo-avatar { width: 128rpx; height: 128rpx; margin: 20rpx; border-radius: 50%;}.userinfo-name { color: #aaa; font-size: 30rpx; margin: 30rpx;}.userinfo-desc { color: #f00; font-size: 50rpx; line-height: 70rpx;}.usermotto { margin-top: 200px;}
演示截图
小程序组件Demo演示截图
以上就是微信小程序的简单实例,希望能帮助开始学习微信开发的朋友,谢谢大家对本站的支持!
路人 在
php中使用hyperf框架调用讯飞星火大模型实现国内版chatgpt功能示例中评论 教程很详细,如果加个前端chatgpt对话页面就完美了..博主 在
科学上网翻墙之v2rayN-Core客户端免费公益节点使用教程中评论 @ mashrdn 多切换几个节点测试,免费ssr是没那么稳..mashrdn 在
科学上网翻墙之v2rayN-Core客户端免费公益节点使用教程中评论 V2rayn免费节点添加上去了,youtobe无法打开网页,是怎么回事..张伟 在
科学上网翻墙之v2rayN-Core客户端免费公益节点使用教程中评论 3q!有用,不过免费节点隔天就要去git上复制新的导进去..博主 在
科学上网翻墙访问Google , 上外网神器佛跳墙VPN(永久免费)使用流程步骤中评论 该篇教程已不能用了,告知大家,免的老有老铁问我!..
Copyright·© 2019 侯体宗版权所有·
粤ICP备20027696号