Blame view

examples/routers/color-picker.vue 3.89 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
          <color-picker
              v-model="color"
              placement="bottom-start"
f2bcd4ad   Graham Fairweather   Color keyboard co...
8
9
              @on-change="c1"
              @on-active-change="c2"></color-picker>
3cf3629f   梁灏   update ColorPicke...
10
          <Input value="hello" style="display: inline-block" />
f2bcd4ad   Graham Fairweather   Color keyboard co...
11
          <Date-picker
f2bcd4ad   Graham Fairweather   Color keyboard co...
12
13
14
15
16
              type="date"
              placeholder="选择日期"
              style="width: 200px"></Date-picker>
          <color-picker
              ref="xxx"
f2bcd4ad   Graham Fairweather   Color keyboard co...
17
18
19
20
21
22
23
24
25
26
27
              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
28
          <!--<Date-picker type="date" placeholder="选择日期" style="width: 200px"></Date-picker>-->
f2bcd4ad   Graham Fairweather   Color keyboard co...
29
30
31
          <color-picker
              v-model="color"
              placement="bottom-start"
737894de   梁灏   ColorPicker suppo...
32
              ></color-picker>
f2bcd4ad   Graham Fairweather   Color keyboard co...
33
34
35
          <Date-picker
              type="date"
              placeholder="选择日期"
f2bcd4ad   Graham Fairweather   Color keyboard co...
36
37
38
39
40
              style="width: 200px"></Date-picker>
          <color-picker
              ref="yyy"
              :colors="colors"
              v-model="color"
f2bcd4ad   Graham Fairweather   Color keyboard co...
41
42
              format="rgb"
              alpha></color-picker>
1f61a559   梁灏   update ColorPicker
43
          <Button @click="setColor">set color</Button>
27d45967   梁灏   #2724 #2672
44
45
  
          <br><br><br><br>
263c991e   Sergio Crisostomo   Add open change e...
46
          {{openState}}
f2bcd4ad   Graham Fairweather   Color keyboard co...
47
48
49
50
51
52
53
54
          <ColorPicker
              v-model="color7"
              :hue="false"
              @on-open-change="onOpenChange"></ColorPicker>
          <ColorPicker
              v-model="color7"
              :hue="false"
              :hide-drop-down="hideDropDown"
f2bcd4ad   Graham Fairweather   Color keyboard co...
55
56
57
58
59
60
              @on-open-change="onOpenChange"></ColorPicker>
  
          <br><br><br><br>
          <ColorPicker
              v-model="color7"
              disabled></ColorPicker>
b6bda1dc   梁灏   update ColorPicker
61
      </div>
c6faec44   梁灏   init ColorPicker
62
  </template>
f2bcd4ad   Graham Fairweather   Color keyboard co...
63
  
c6faec44   梁灏   init ColorPicker
64
  <script>
f2bcd4ad   Graham Fairweather   Color keyboard co...
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
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
  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
149
          },
f2bcd4ad   Graham Fairweather   Color keyboard co...
150
151
      },
  };
263c991e   Sergio Crisostomo   Add open change e...
152
  </script>