## wx:for練習
>post.wxml
```
<block wx:for="{{post_content}}" wx:for-item="item">
<view class="post-container">
<view class="post-author-date">
<image class="post-author" src="{{ item.author_img }}"></image>
<text class="post-date">{{ item.date }}</text>
</view>
<text class="post-title">{{ item.title }}</text>
<image class="post-image" src="{{item.post_img}}"></image>
<text class="post-content">{{ item.content }}</text>
<view class="post-like">
<image class="post-like-image" src="../../images/icon/chat.png"></image>
<text class="post-like-font">{{ item.collect_num }}</text>
<image class="post-like-image" src="../../images/icon/view.png"></image>
<text class="post-like-font">{{ item.view_num }}</text>
</view>
</view>
</block>
```
>post.js
```
// pages/posts/posts.js
Page({
/\*\*
\* 頁面的初始數據
\*/
data: {
},
/\*\*
\* 生命周期函數--監聽頁面加載
\*/
onLoad: function(options) {
var post\_content = \[{
date: 'Nov 18 2019',
title: '正是蝦肥蟹胖時',
post\_img: "/images/post/crab.png",
content: '菊黃蟹正肥,品嘗秋之味。徐志摩把,“看初花的荻蘆”和“到樓外樓吃蟹”,并列為秋天來杭州不能錯過的風雅之事;用林妹妹的話講是“螯封嫩玉雙雙滿',
view\_num: '112',
collect\_num: '96',
author\_img: '/images/avatar/1.png'
}, {
date: 'Sep 25 2016',
title: '比利-林恩的中場故事',
post\_img: '/images/post/bl.png',
content: '一 “李安是一位絕不會重復自己的導演,本片將極富原創性李安眾所矚目的新片《比利林恩漫長的中場休息》,正式更名《半場無戰事》。',
view\_num: '96',
collect\_num: '112',
author\_img: '/images/avatar/2.png'
}\]
this.setData({
post\_content
})
},
/\*\*
\* 生命周期函數--監聽頁面初次渲染完成
\*/
onReady: function() {
},
/\*\*
\* 生命周期函數--監聽頁面顯示
\*/
onShow: function() {
},
/\*\*
\* 生命周期函數--監聽頁面隱藏
\*/
onHide: function() {
},
/\*\*
\* 生命周期函數--監聽頁面卸載
\*/
onUnload: function() {
},
/\*\*
\* 頁面相關事件處理函數--監聽用戶下拉動作
\*/
onPullDownRefresh: function() {
},
/\*\*
\* 頁面上拉觸底事件的處理函數
\*/
onReachBottom: function() {
},
/\*\*
\* 用戶點擊右上角分享
\*/
onShareAppMessage: function() {
}
})
```
- PHP獲取客戶端瀏覽器信息和版本
- PHP獲取客戶端操作系統信息
- 無限級分類
- git使用
- 權限檢測思路
- Vue學習
- 遇到的一些問題
- PHP的編碼思維和技巧
- mysql復習
- tp5
- ThinkPHP5.x 公共函數
- TP5登錄注冊
- TP5使用模板繼承
- ThinkPHP5.1 清除緩存
- thinkphp5實現安裝程序
- 安全
- tp中實現跨域代碼
- ThinkPHP5.1配合pjax實現菜單欄無刷新跳轉
- 獲取數據庫版本和數據庫大小
- 模型的基本CURD操作
- 商品spu
- 全局異常處理類
- ExceptionHandler
- BaseException
- PHP函數之error_reporting(E_ALL ^ E_NOTICE)詳細說明
- 微信小程序
- wx:for
- tp6
- 分離的一些模塊
- session開啟
- Spring
- 依賴注入
- 數據結構
- 二叉樹
- js獲取地址欄變量
- PHP設計模式
- 面向對象
- PHP1
- PHP性能優化
- Java學習
- static關鍵字
- 多態
- 接口、階乘
- 大佬給的面試題
- 訪問量為5000萬的博客系統設計
- PHP可變參數
- Nginx的配置案例
- 求數組中的最大值,并返回數組索引
- PHP面試方向
- PHP數組工具類ArrUtil
- 字符串工具類StrUtil
- PHP使用curl發送請求
- mysql
- PHP上傳base64圖片處理函數
- webstorm小程序常用配置
- 郵箱正則表達式
- leetcode mysql記錄
- 函數庫