1.关于scroll-view scroll-view是小程序用来控制可滚动视图区域的组件. 通过设置scroll-x ="true" 或 scroll-y="true" 来分别控制横向滚动或纵向滚动:这里需要注意的一点: 使用竖向滚动时,需要给<scroll-view/>一个固定高度,通过 WXSS 设置 height 2.使用scroll-view来实现一个介绍页长图的完整滚动显示 本以为是一个简单的需求,没想到也会采坑: 第一版实现思路及代码如下:…
WXML WXML能力: 数据绑定 列表渲染 条件渲染 模板 事件 数据绑定 数据绑定使用 Mustache 语法(双大括号)将变量包起来,可作用于内容,组件属性(需要在双引号之内),控制属性(需要在双引号之内),关键字(需要在双引号之内),运算,逻辑判断,字符串运算,数据路径运算,组合,数组,对象. 详细内容见:https://developers.weixin.qq.com/miniprogram/dev/framework/view/wxml/data.html 列表渲染 wx:for 在…
wxParse的GitHub地址:https://github.com/icindy/wxParse 一.数据内容: 请求地址:https://m.quanchepin.com/index.php?app=mobile_bespeak_card&act=detail_image&id=23 结果(有时在想为什么微信不对接HTML标签,然后自己需要哪些标签再加上去不是更好?): 二.GitHub上下载wxParse文件,主要是wxParse文件夹的内容. 三.把wxParse文件夹放到小程序…
目录 1.页面展示 2.wxml代码 3.wxss代码 4.js代码 1.页面展示 2.wxml代码 <!--pages/register/register.wxml--> <scroll-view> <image src='/images/register.png' mode='widthFix' class="topImage"></image> <view class='input-top'> <input id=…
组件的通用属性: id class style hidden bind* catch* data-* view 小程序基础组件,基本等于最常用组件,类似于HTML中的div.view用于构建页面骨架,实现页面基础结构的划分 <view hover-class="hover"> <!-- hover-class: 按下去的属性样式 属性值为类名 --> <!-- 可以嵌套其他标签 --> </view> text 文本.只用text包裹的文…
<view class="content"> <view class="today"> <view class="info"> <view class="temp">{{today.wendu}}℃</view> <view class="weather">{{today.todayInfo.type}} {{today.todayIn…
wx.getSystemInfo({ success: function (res) { that.globalData.winWidth = res.windowWidth; that.globalData.winHeight = res.windowHeight; } }) 以上,app.js中 先获取整体高度 赋值给全局变量 <swiper class='swiper' current="{{currentTab}}" duration="300" bi…
设置 wx.setClipboardData  // 复制功能 获取 wx.getClipboardData // 粘贴功能     let _this = this     wx.setClipboardData({       data: _this.data.phone,       success: function (res) {         console.log("复制成功:", res)       },     })  …
废话不多说, 先上图: <!--pages/index/to_news/to_news.wxml--> <view class='tab'> <view class='lan'>{{tabdata.title}}</view> <view class='tent'> <text>{{tabdata.attribute_attribute}}</text> <text class='fl_r '>{{tabdat…
1.获取屏幕宽度,并赋值给view <view class="ships-img" style="height:{{windowWidth}}px;"></view> wx.getSystemInfo({ success: function (res) { // console.log(res.windowWidth) 屏幕宽度 that.setData({ windowWidth: res.windowWidth }) } }) 2.最近遇…