==========================
flex【盒子】
display: flex;
flex-direction: column; 【从上到下排列】↓
justify-content: center; 【距上方 和距下边 —— 距离一致】
align-items: center; 【距左+距右—— 距离一致】
flex-direction: row;
vertical-align: middle;
==========================
数组:
console.log(postData.postList);
wx.setStorageSync('key', "这是缓存")
【不能超过10MB】
//清除所有缓存
wx.clearStorageSync()
wx.removeStorageSync('key')
格式化代码:alt+shift+f
脚本文件运行,不运行的
<import src="post-item/post-item-template.wxml" />
注意最后的【/】(结尾符合)
引入文件
css;
@import "post-item/post-item-template.wxss";
var postData = require('../../../data/post-data.js')
{{...item}}" /> ...为展开
======================================================
判断使用三元表达式:
<image class='audio' catchtap='onMusicTap' src="{{isPlayingMusic?'https://myphp.vip/img/wx/music/music-stop.png':'https://myphp.vip/img/wx/music/music-start.png'}}"></image>
<!-- <image wx:if="{{isPlayingMusic}}" class='audio' catchtap='onMusicTap' src="https://myphp.vip/img/wx/music/music-start.png"></image> -->
<!-- <image wx:else="{{isPlayingMusic}}" class='audio' catchtap='onMusicTap' src="https://myphp.vip/img/wx/music/music-stop.png"></image> -->
--------------
大【target】和【currentTarget】
target指的是当前点击的组件 和 currentTarget 指的是时间捕获的组件
target这里只的是image,而currentTarget 指的是swiper
onBannerTap:function(event)
{
console.log(event);
var postId = event.currentTarget.dataset.postid; ()
wx.navigateTo({
url: "post-detail/post-detail?id=" + postId
})
}
======================================================
命名规范:
date:
title
imgSrc
avatar:
content:
reading:
=======================================================
<!-- Banner轮播图 start -->
<view>
<swiper autoplay="true" indicator-dots="true" circular='true' interval="1500" >
<swiper-item>
<image src='{{muke.image1}}'></image>
</swiper-item>
<swiper-item>
<image src='{{muke.image2}}'></image>
</swiper-item>
<swiper-item>
<image src='{{muke.image3}}'></image>
</swiper-item>
</swiper>
</view>
<!-- Banner轮播图 end -->
<block wx:for="{{post_key}}" wx:for-item="item" wx:for-index="ids">
{{ids}} 为索引
{{item}} 为值
{{item.image}}
</block>
<view>
<View style="width:100%">
<text style='color:red;margin-left:150rpx;'>
【柴静雾霾调查:穹顶之下(完整版)】
</text>
</View>
<view >
<video style="width: 100%;height=400px;margin:1px;" src="{{video}}" binderror="videoErrorCallback"></video>
</view>
</view>
----------------------------
this.setData({
post_key:post_content
}),
template模板:
<!-- 新闻内容 start -->
<block wx:for="{{postList}}" wx:for-item="item" wx:for-index="ids">
<template is="postItem" data="{{...item}}" />
</block>
<!-- 新闻内容 end -->
- 微信小程序,前端大梦想(六)
微信小程序,前端大梦想(六) 微信小程序之联合百度API实现定位 定位功能对于我们都不陌生,在移动端的应用中更是不可或缺的功能,小程序中也提供了对应的API帮助我们完成定位的实现,但是目前小程序的定位 ...
- 微信小程序前端页面书写
微信小程序前端页面书写 WXML(WeiXin Markup Language)是框架设计的一套标签语言,结合基础组件.事件系统,可以构建出页面的结构. 一.数据绑定 1. 普通写法 <view ...
- 微信小程序前端样式WXSS书写
微信小程序前端样式WXSS书写 一. WXSS的简单介绍 WXSS(WeiXin Style Sheets)是一套样式语言,用于描述 WXML 的组件样式. 与 CSS 相比,WXSS 扩展的特性有: ...
- 关于微信小程序前端Canvas组件教程
关于微信小程序前端Canvas组件教程 微信小程序Canvas接口函数 上述为微信小程序Canvas的内部接口,通过熟练使用Canvas,即可画出较为美观的前端页面.下面是使用微信小程序画图的一些 ...
- 微信小程序前端与myeclipse的数据交换过程(SSH)
这是我个人探究微信小程序前端与后端之间的数据交换的过程,再结合个人所学的SSH框架, 编程工具用myEclipse2014工具.当然,前提是后台的项目要部署到tomcat服务器上才行, 然后总结了从后 ...
- 微信小程序前端源码逻辑和工作流
看完微信小程序的前端代码真的让我热血沸腾啊,代码逻辑和设计一目了然,没有多余的东西,真的是大道至简. 废话不多说,直接分析前端代码.个人观点,难免有疏漏,仅供参考. 文件基本结构: 先看入口app.j ...
- 微信小程序,前端大梦想(一)
小程序框架MINA简介 微信公众平台"小程序"具有不是APP胜似APP的效果,是一种不需要下载安装即可使用的应用,它实现了应用"触手可及"的梦想,用 ...
- 微信小程序,前端大梦想(二)
微信小程序的视图与渲染 今天我们从四个方面来了解小程序: •组件的基本使用 •数据绑定 •渲染标签 •模板的使用 一.组件的基本使用: 微信小程序为我们的开发提供了丰富的UI组件 ...
- 微信小程序前端开发踩坑(一)
之前由于不了解微信小程序的整个的运行开发机制,走了很多的弯路,脑子灵光的可能不会遇到,这个主题系列的帖子希望可以帮助到像我一样理解能力慢的孩子. 不论是开发微信小程序还是说学习任何一门编程语言,最重要 ...
随机推荐
- 深入理解7816(3)-----关于T=0 【转】
本文转载自:http://blog.sina.com.cn/s/blog_4df8400a0102vcyp.html 深入理解7816(3)-----关于T=0 卡片和终端之间的数据传输是通过命令响应 ...
- bzoj1607 [Usaco2008 Dec]Patting Heads 轻拍牛头——暴力
题目:https://www.lydsy.com/JudgeOnline/problem.php?id=1607 观察一下数据范围,就是纯粹的暴力. 代码如下: #include<iostrea ...
- H5 触摸事件
HTML5中新添加了很多事件,但是由于他们的兼容问题不是很理想,应用实战性不是太强,所以在这里基本省略,咱们只分享应用广泛兼容不错的事件,日后随着兼容情况提升以后再陆续添加分享.今天为大家介绍的事件主 ...
- $P2121 拆地毯$
\(problem\) \(kruskal\)的模板题. #ifdef Dubug #endif #include <bits/stdc++.h> using namespace std; ...
- $P5018 对称二叉树$
problem 一直忘记给这个题写题解了. 这题挺水的吧. 挺后悔当时没写出来. #ifdef Dubug #endif #include <bits/stdc++.h> using na ...
- c# winform控件dock属性停造位置、摆放顺序详解
dock : [英文释义- 码头.依靠][winform释义- 获取或设置当前控件依靠到父容器的哪一个边缘.] 用途:多数控件都有这个属性,主要用来设置控件的布局. 但对于不太了解这个属性的朋友来说有 ...
- MVC系列学习(十五)-验证码
1.方式一: public class VCode { /// <summary> /// 生成验证码图片 字节数组 /// </summary> /// <return ...
- GridView动态计算高度
// 动态加载GridView 高度 public static void setListViewHeightBasedOnChildren(MyGridView myGridView) { List ...
- vm装xp安装成功后进入不了系统
1.如果是用虚拟光驱,你肯定步骤是先新建的虚拟机,再安装的虚拟光驱,所以会出现这样的问题.(请先安装虚拟光驱,再新建虚拟机,再用虚拟光驱加载镜像文件,问题解决)2.如果是直接使用的镜像,那么在GHOS ...
- Centos6.7 ELK日志系统部署
Centos6.7 ELK日志系统部署 原文地址:http://www.cnblogs.com/caoguo/p/4991602.html 一. 环境 elk服务器:192.168.55.134 lo ...