Blame view

examples/routers/checkbox.vue 1.21 KB
cbe03a12   梁灏   support Checkbox
1
2
  <template>
      <div>
a81253ec   Rijn   Update checkbox t...
3
4
5
6
7
8
9
10
          <div>
              <Checkbox true-value="true" false-value="false" v-model="testValue1">test string</Checkbox>
              {{ testValue1 }}
          </div>
          <div>
              <Checkbox :true-value="0" :false-value="1" v-model="testValue2">test number</Checkbox>
              {{ testValue2 }}
          </div>
cbe03a12   梁灏   support Checkbox
11
          <Checkbox-group v-model="fruit">
a81253ec   Rijn   Update checkbox t...
12
              <Checkbox v-for="item in tags" :label="item.label" :key="item.label" true-value="true"></Checkbox>
cbe03a12   梁灏   support Checkbox
13
          </Checkbox-group>
01b8d340   梁灏   fixed #778
14
          <div>{{ fruit }}</div>
cbe03a12   梁灏   support Checkbox
15
16
17
18
19
20
21
22
      </div>
  </template>
  <script>
      export default {
          data () {
              return {
                  social: ['facebook', 'github'],
                  fruit: ['苹果'],
a81253ec   Rijn   Update checkbox t...
23
24
25
                  tags: [],
                  testValue1: null,
                  testValue2: null
cbe03a12   梁灏   support Checkbox
26
27
              }
          },
01b8d340   梁灏   fixed #778
28
29
30
31
32
33
34
35
36
37
38
39
40
41
          mounted () {
              setTimeout(() => {
                  this.tags = [
                      {
                          label: '香蕉'
                      },
                      {
                          label: '苹果'
                      },
                      {
                          label: '西瓜'
                      }
                  ]
              }, 1000);
cbe03a12   梁灏   support Checkbox
42
43
44
          }
      }
  </script>