[toc]
## 組件中無法加載到全局樣式
在組件的js中添加以下代碼
```
options: {
addGlobalClass: true
}
```
## bindtap傳參
```
## wxml
<list wx:for="{{list}}" wx:for-item="item" data-gid="1" bindtap="detail" ></list>
## js
detail: function(e) {
console.log(e.currentTarget.dataset.gid)
}
```
## 組件監聽properties改變事件
```
properties: {
date: {
type: null,
value: null,
observer: function () {
// 值改變時間
}
}
}
```
## 設置小程序更新
```
setUpdate: function() {
const updateManager = wx.getUpdateManager()
updateManager.onCheckForUpdate(function (res) {
// 請求完新版本信息的回調
console.log(res.hasUpdate)
})
updateManager.onUpdateReady(function () {
wx.showModal({
title: '更新提示',
content: '新版本已經準備好,是否重啟應用?',
success: function (res) {
if (res.confirm) {
// 新的版本已經下載好,調用 applyUpdate 應用新版本并重啟
updateManager.applyUpdate()
}
}
})
})
updateManager.onUpdateFailed(function () {
// 新版本下載失敗
})
}
```
## 樣式處理
1. 文字加下劃線`text-decoration: underline;`
2. 文字加刪除線`text-decoration:line-through;`
- php
- 安全
- php7
- 特性
- 編譯安裝
- 源碼整體框架
- 基本變量
- thinkphp3.2.3
- thinkphp5.0
- thinkphp6.0
- laravel
- 配置
- 路由
- artisan控制臺
- eloquent
- tinker
- composer
- 加密解密
- 小知識點
- 數組
- string
- 代碼簡潔之道
- 編譯
- 語法糖
- lumen
- smarty
- 錯題集
- 算法及數據結構
- 線性表結構
- 插入排序
- 冒泡排序
- 數據庫
- mysql
- oracle
- PostgreSQL
- redis
- sqlserver
- 前端
- 備忘
- js
- nodejs
- vue
- css
- electron
- vue
- 語法糖
- colorui使用筆記
- 微信小程序
- 操作系統
- windows
- bat
- 快捷鍵
- linux
- sed
- 問題解決
- git
- docker
- docker-compose
- 正則表達式
- ps
- lua
- 協議相關
- 問題思索
- Golang
- 測試
- 讀取和寫入json配置文件
- 類
- 接口
- mod
- gin
- fyne
- 禪道二次開發
- 服務
- apache
- 漏洞配置
- http server優化
- nginx
- 安裝
- 面試題庫
- freeswitch