liangjin
2021-04-21 3464c6fe6167dec49edff803dc3b0a411ffd5e52
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/*
 * @Author: 小明丶
 * @Date: 2019-08-15 10:40:29
 * @LastEditors: 小明丶
 * @LastEditTime: 2019-09-02 09:38:20
 * @Description: 注册want组件
 */
import {
    Button,
    Swipe,
    SwipeItem,
    Dialog,
    Checkbox,
    CheckboxGroup,
    Search,
    Icon,
    NumberKeyboard,
    Notify,
    Loading,
    Popup,
    Picker,
    Tabbar,
    TabbarItem,
    NavBar,
    Cell,
    CellGroup,
    RadioGroup,
    Radio,
    Area,
    Field,
    Collapse,
    CollapseItem,
    DatetimePicker,
    Toast,
    List,
    Switch,ActionSheet
} from 'vant';
 
let arr = [
    Button,
    Swipe,
    SwipeItem,
    Dialog,
    Checkbox,
    CheckboxGroup,
    Search,
    Icon,
    NumberKeyboard,
    Notify,
    Loading,
    Popup,
    Picker,
    Tabbar, TabbarItem,
    NavBar,
    Cell, CellGroup, RadioGroup,
    Radio,
    Area,
    Field,
    Collapse, CollapseItem,
    DatetimePicker,
    Toast,
    List,
    Switch,ActionSheet
]
 
// Notify.setDefaultOptions({
//     background: '#896EDB'
// })
 
export default {
    install(Vue, opt) {
        arr.forEach(item => {
            Vue.use(item)
        })
        
        // Vue.prototype.$notify = (text) => {
        //     Notify({
        //         message: text,
        //         background: 'red'
        //     })
        // }
 
        Vue.prototype.$notify_success = (text) => {
            Notify({
                message: text,
                background: '#1989fa'
            })
        }
    }
}