> ## :-: [小程序簡介](https://developers.weixin.qq.com/miniprogram/dev/framework/quickstart/) (2019-7-8)
小程序是一種全新的連接用戶與服務的方式,它可以在微信內被便捷地獲取和傳播,同時具有出色的使用體驗。
> ## :-: 起步 (2019-7-8)
```
view == div
image == img
text == span
```
> ## :-: 組件引入
// 模塊模版 -- components/bigimgcmp.wxml
```
<view class="box" style="background: #176;">
<image src="{{imgSrc}}" />
<text>{{mainTitle}}</text>
</view>
```
// 模塊樣式 -- components/bigimgcmp.wxss
```
.box {
box-sizing: border-box;
width: 100%;
padding: 20rpx;
display: flex;
flex-wrap: wrap;
justify-content: center;
border-radius: 10px;
margin-bottom: 20rpx;
}
.box>image {
width: 100%;
margin-bottom: 10rpx;
border-radius: 10px;
}
.box>text {
line-height: 50rpx;
vertical-align: middle;
color: aqua;
}
```
// 模塊配置 -- components/bigimg/index.js
```
Component({
/**
* 組件的屬性列表
*/
properties: {
// properties 優先于 data 的數據、
// 簡寫(初始值:String == '' | Boolean == false | Number == 0 )
imgSrc: String,
mainTitle: String,
// 更細致的寫法
// imgSrc: {
// type: String,
// value: '--',
// observer: function(newVal, oldVal, changePath) {
// console.log(newVal, oldVal, changePath);
// }
// },
// mainTitle: {
// type: String,
// value: '我是標題、我是標題、我是標題',
// observer: function(newVal, oldVal, changePath) {
// newVal -- 被改變的新數據 | oldVal -- 上一次的舊數據
// console.log(newVal, oldVal, changePath);
// }
// }
},
})
```
配置引入模塊 -- idnex.json
```
{
"usingComponents": {
"d-bigImg": "/components/bigimg/cmp"
}
}
```
引入模塊 -- idnex.wxml
```
<d-bigImg img-src="http://p6.qhimg.com/bdm/480_296_0/t01874c1dcff33cfb54.jpg" main-title="Demo - 引入組件" />
```
:-: **效果圖**
 
## :-: [Behavior](https://developers.weixin.qq.com/miniprogram/dev/framework/custom-component/behaviors.html)
```
// -- 模塊文件
let oB = Behavior({
properties: {
headPortraitSrc: String,
nickname: String,
content: String,
subtitle: String,
label: String,
selected: Boolean,
like: Boolean
}
});
export { oB };
// -- 入口文件
import { oB } from "../my-behavior.js";
Component({
// Behavior -- 行為引入、
behaviors: [oB],
/**
* 組件的屬性列表,properties 屬性的數據會經過行為方法引入、
*/
// properties: { headPortraitSrc:String, nickname:String, content:String, subtitle:String, label:String, like:Boolean },
});
```
- 前端工具庫
- HTML
- CSS
- 實用樣式
- JavaScript
- 模擬運動
- 深入數組擴展
- JavaScript_補充
- jQuery
- 自定義插件
- 網絡 · 后端請求
- css3.0 - 2019-2-28
- 選擇器
- 邊界樣式
- text 字體系列
- 盒子模型
- 動圖效果
- 其他
- less - 用法
- scss - 用法 2019-9-26
- HTML5 - 2019-3-21
- canvas - 畫布
- SVG - 矢量圖
- 多媒體類
- H5 - 其他
- webpack - 自動化構建
- webpack - 起步
- webpack -- 環境配置
- gulp
- ES6 - 2019-4-21
- HTML5補充 - 2019-6-30
- 微信小程序 2019-7-8
- 全局配置
- 頁面配置
- 組件生命周期
- 自定義組件 - 2019-7-14
- Git 基本操作 - 2019-7-16
- vue框架 - 2019-7-17
- 基本使用 - 2019-7-18
- 自定義功能 - 2019-7-20
- 自定義組件 - 2019-7-22
- 腳手架的使用 - 2019-7-25
- vue - 終端常用命令
- Vue Router - 路由 (基礎)
- Vue Router - 路由 (高級)
- 路由插件配置 - 2019-7-29
- 路由 - 一個實例
- VUEX_數據倉庫 - 2019-8-2
- Vue CLI 項目配置 - 2019-8-5
- 單元測試 - 2019-8-6
- 掛載全局組件 - 2019-11-14
- React框架
- React基本使用
- React - 組件化 2019-8-25
- React - 組件間交互 2019-8-26
- React - setState 2019-11-19
- React - slot 2019-11-19
- React - 生命周期 2019-8-26
- props屬性校驗 2019-11-26
- React - 路由 2019-8-28
- React - ref 2019-11-26
- React - Context 2019-11-27
- PureComponent - 性能優化 2019-11-27
- Render Props VS HOC 2019-11-27
- Portals - 插槽 2019-11-28
- React - Event 2019-11-29
- React - 渲染原理 2019-11-29
- Node.js
- 模塊收納
- dome
- nodejs - tsconfig.json
- TypeScript - 2020-3-5
- TypeScript - 基礎 2020-3-6
- TypeScript - 進階 2020-3-9
- Ordinary小助手
- uni-app
- 高德地圖api
- mysql
- EVENTS
- 筆記
- 關于小程序工具方法封裝
- Tool/basics
- Tool/web
- parsedUrl
- request