Blame view

examples/routers/color-picker.vue 4.04 KB
c6faec44   梁灏   init ColorPicker
1
  <template>
b6bda1dc   梁灏   update ColorPicker
2
      <div style="margin: 100px;">
f2bcd4ad   Graham Fairweather   Color keyboard co...
3
          {{color}}
b6bda1dc   梁灏   update ColorPicker
4
          <!--<Input placeholder="请输入..." size="large" style="width: 50px;"></Input>-->
f2bcd4ad   Graham Fairweather   Color keyboard co...
5
6
7
8
9
10
          <color-picker
              v-model="color"
              placement="bottom-start"
              size="large"
              @on-change="c1"
              @on-active-change="c2"></color-picker>
3cf3629f   梁灏   update ColorPicke...
11
          <Input value="hello" style="display: inline-block" />
f2bcd4ad   Graham Fairweather   Color keyboard co...
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
          <Date-picker
              transfer
              type="date"
              placeholder="选择日期"
              style="width: 200px"></Date-picker>
          <color-picker
              ref="xxx"
              :transfer="true"
              v-model="color"
              :recommend="true"
              format="rgb"
              alpha
              @on-change="onChange"
              @on-active-change="onActiveChange"></color-picker>
          <color-picker
              v-model="color2"
              :alpha="true"
              :recommend="false"
              format="hsv"></color-picker>
b6bda1dc   梁灏   update ColorPicker
31
          <!--<Date-picker type="date" placeholder="选择日期" style="width: 200px"></Date-picker>-->
f2bcd4ad   Graham Fairweather   Color keyboard co...
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
          <color-picker
              v-model="color"
              placement="bottom-start"
              size="small"></color-picker>
          <Date-picker
              type="date"
              placeholder="选择日期"
              size="small"
              style="width: 200px"></Date-picker>
          <color-picker
              ref="yyy"
              :colors="colors"
              v-model="color"
              transfer
              format="rgb"
              alpha></color-picker>
1f61a559   梁灏   update ColorPicker
48
          <Button @click="setColor">set color</Button>
27d45967   梁灏   #2724 #2672
49
50
  
          <br><br><br><br>
263c991e   Sergio Crisostomo   Add open change e...
51
          {{openState}}
f2bcd4ad   Graham Fairweather   Color keyboard co...
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
          <ColorPicker
              v-model="color7"
              :hue="false"
              @on-open-change="onOpenChange"></ColorPicker>
          <ColorPicker
              v-model="color7"
              :hue="false"
              :hide-drop-down="hideDropDown"
              transfer
              @on-open-change="onOpenChange"></ColorPicker>
  
          <br><br><br><br>
          <ColorPicker
              v-model="color7"
              disabled></ColorPicker>
b6bda1dc   梁灏   update ColorPicker
67
      </div>
c6faec44   梁灏   init ColorPicker
68
  </template>
f2bcd4ad   Graham Fairweather   Color keyboard co...
69
  
c6faec44   梁灏   init ColorPicker
70
  <script>
f2bcd4ad   Graham Fairweather   Color keyboard co...
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
  export default {
      props: {},
  
      data() {
          return {
              color: 'rgba(12,34,255,.85)',
              color2: '',
              color7: '#19be6b',
              openState: false,
              colors: [
                  '#2d8cf0',
                  '#19be6b',
                  '#ff9900',
                  '#ed3f14',
                  '#00b5ff',
                  '#19c919',
                  '#f9e31c',
                  '#ea1a1a',
                  '#9b1dea',
                  '#00c2b1',
                  '#ac7a33',
                  '#1d35ea',
                  '#8bc34a',
                  '#f16b62',
                  '#ea4ca3',
                  '#0d94aa',
                  '#febd79',
                  '#5d4037',
                  '#00bcd4',
                  '#f06292',
                  '#cddc39',
                  '#607d8b',
                  '#000000',
                  '#ffffff',
                  '#2d8cf0',
                  '#19be6b',
                  '#ff9900',
                  '#ed3f14',
                  '#00b5ff',
                  '#19c919',
                  '#f9e31c',
                  '#ea1a1a',
                  '#9b1dea',
                  '#00c2b1',
                  '#ac7a33',
                  '#1d35ea',
                  '#8bc34a',
                  '#f16b62',
                  '#ea4ca3',
                  '#0d94aa',
                  '#febd79',
                  '#5d4037',
              ],
              hideDropDown: false,
          };
      },
  
      computed: {},
  
      mounted() {
          setInterval(this.toggleShowHide, 2000);
      },
  
      methods: {
          setColor() {
              this.color = '#26bc77';
          },
          c1(d) {
              console.log(d);
          },
          c2(d) {
              console.log(d);
          },
          onOpenChange(state) {
              this.openState = state;
          },
          onChange(d) {
              console.log(d);
          },
          onActiveChange(d) {
              console.log(d);
          },
          toggleShowHide() {
              this.hideDropDown = !this.hideDropDown;
c6faec44   梁灏   init ColorPicker
155
          },
f2bcd4ad   Graham Fairweather   Color keyboard co...
156
157
      },
  };
263c991e   Sergio Crisostomo   Add open change e...
158
  </script>