### json字符串轉json對象
```
let str = '{abc:123}'
let json = evil(str)
```
### 數據循環處理
```
let data = [
{model:123},
{model:456},
{model:789}
]
data.forEach(value => {
console.log(value.model)
})
//---------------------
var person = {fname:"Bill", lname:"Gates", age:62};
var text = "";
var x;
for (x in person) {
text += person[x];
}
```
### @/libs/tools下的常用函數說明
#### forEach
~~~
let list = list: [
{ a: 1, b: 2 },
{ a: 3, b: 3 },
{ a: 4, b: 4 },
{ a: 5, b: 6 }
]
forEach(list, function (item, i, arr) {
console.log(item, i, arr)
})
~~~
#### getIntersection
>* @param {Array} arr1
>* @param {Array} arr2
>* @description 得到兩個數組的交集, 兩個數組的元素為數值或字符串
```
let list2=[1, 2, 3, 4, 5, 6]
let list3=[1, 7, 9, 4, 5, 6]
let newArr = getIntersection(list2, list3)
console.log(newArr)
//輸出 [1, 4, 5, 6]
```
#### getUnion
>* @param {Array} arr1
>* @param {Array} arr2
>* @description得到兩個數組的并集, 兩個數組的元素為數值或字符串
```
let list2=[1, 2, 3, 4, 5, 6]
let list3=[1, 7, 9, 4, 5, 6]
let newArr = getUnion(list2, list3)
console.log(newArr)
//輸出[1, 2, 3, 4, 5, 6, 7, 9]
```
### oneOf
> @param {String|Number} value 要驗證的字符串或數值
> @param {*} validList 用來驗證的列表
```
let a = 20
let arr = [10,20,30,40]
if ( oneOf(a, arr) === true)
```
### hasKey
> 判斷一個對象是否存在key,如果傳入第二個參數key,則是判斷這個obj對象是否存在key這個屬性
> 如果沒有傳入key這個參數,則判斷obj對象是否有鍵值對
~~~
console.log(hasKey({ a: 1, b: 2, c: 3 }, 'a'))
~~~
- vue學習方向
- iview-admin項目說明
- 快速開始
- 開發工具
- 開始開發
- 接口的定義和調用
- 常用函數匯總
- 組件的定義
- iview開發規范說明
- 插件使用說明
- 時間插件
- 命名規范
- vue變量函數規則
- 接口嵌套使用說明
- 組件建立說明
- vue使用規范
- 數據檢測特別說名
- iview-layout-themes
- util
- common
- xeUtils詳細說明
- form表單自動生成
- theme1使用說明
- theme2使用說明
- hd-login登錄組件說明
- wl-upload-files圖片上傳組件
- wl-upload-imgs
- wl-upload-oss-files
- wl-read-excel
- wl-dir-upload選擇文件架
- system組件說明
- 機構管理wl-company-manager
- 用戶管理
- wl-excel-import Excel數據導入
- 前臺使用說明
- 后臺使用說明
- Excel使用說明
- wl-vue2-editor
- 字符串截取方法
- redis常用說明
- 推薦redis使用規范