Blame view

examples/routers/modal.vue 5.54 KB
6259471f   梁灏   support Modal
1
2
  <template>
      <div>
7bafe9d9   梁灏   fixes #4453 #4480...
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
          <Button type="primary" @click="modal1 = true">Display dialog box</Button>
          <Modal
                  v-model="modal1"
                  title="Common Modal dialog box title"
                  @on-ok="ok"
                  @on-cancel="cancel">
              <p>Content of dialog</p>
              <p>Content of dialog</p>
              <p>Content of dialog</p>
              <Button @click="openMessage">Message</Button>
              <Select v-model="model1" style="width:200px" :transfer="false">
                  <Option v-for="item in cityList" :value="item.value" :key="item.value">{{ item.label }}</Option>
              </Select>
              <Select v-model="model1" style="width:200px" :transfer="true">
                  <Option v-for="item in cityList" :value="item.value" :key="item.value">{{ item.label }}</Option>
              </Select>
              <Dropdown transfer>
                  <a href="javascript:void(0)">
                      下拉菜单
                      <Icon type="ios-arrow-down"></Icon>
                  </a>
                  <DropdownMenu slot="list">
                      <DropdownItem>驴打滚</DropdownItem>
                      <DropdownItem>炸酱面</DropdownItem>
                      <DropdownItem disabled>豆汁儿</DropdownItem>
                      <DropdownItem>冰糖葫芦</DropdownItem>
                      <DropdownItem divided>北京烤鸭</DropdownItem>
                  </DropdownMenu>
              </Dropdown>
              <DatePicker type="date" placeholder="Select date" style="width: 200px" transfer></DatePicker>
              <Cascader :data="data" v-model="value1" transfer></Cascader>
              <Tooltip content="Here is the prompt text" transfer>
                  A balloon appears when the mouse passes over this text
              </Tooltip>
              <Poptip trigger="hover" title="Title" content="content" transfer>
                  <Button>Hover</Button>
              </Poptip>
              <Button type="primary" @click="handleSpinShow">整页显示,3秒后关闭</Button>
707a3d82   梁灏   update Modal for ...
41
          </Modal>
7bafe9d9   梁灏   fixes #4453 #4480...
42
43
44
45
46
47
          <Select v-model="model1" style="width:200px" :transfer="false">
              <Option v-for="item in cityList" :value="item.value" :key="item.value">{{ item.label }}</Option>
          </Select>
          <Select v-model="model1" style="width:200px" :transfer="true">
              <Option v-for="item in cityList" :value="item.value" :key="item.value">{{ item.label }}</Option>
          </Select>
6259471f   梁灏   support Modal
48
49
50
51
      </div>
  </template>
  <script>
      export default {
707a3d82   梁灏   update Modal for ...
52
53
          data () {
              return {
7bafe9d9   梁灏   fixes #4453 #4480...
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
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
                  modal1: false,
                  cityList: [
                      {
                          value: 'New York',
                          label: 'New York'
                      },
                      {
                          value: 'London',
                          label: 'London'
                      },
                      {
                          value: 'Sydney',
                          label: 'Sydney'
                      },
                      {
                          value: 'Ottawa',
                          label: 'Ottawa'
                      },
                      {
                          value: 'Paris',
                          label: 'Paris'
                      },
                      {
                          value: 'Canberra',
                          label: 'Canberra'
                      }
                  ],
                  model1: '',
                  value1: [],
                  data: [{
                      value: 'beijing',
                      label: '北京',
                      children: [
                          {
                              value: 'gugong',
                              label: '故宫'
                          },
                          {
                              value: 'tiantan',
                              label: '天坛'
                          },
                          {
                              value: 'wangfujing',
                              label: '王府井'
                          }
                      ]
                  }, {
                      value: 'jiangsu',
                      label: '江苏',
                      children: [
                          {
                              value: 'nanjing',
                              label: '南京',
                              children: [
                                  {
                                      value: 'fuzimiao',
                                      label: '夫子庙',
                                  }
                              ]
                          },
                          {
                              value: 'suzhou',
                              label: '苏州',
                              children: [
                                  {
                                      value: 'zhuozhengyuan',
                                      label: '拙政园',
                                  },
                                  {
                                      value: 'shizilin',
                                      label: '狮子林',
                                  }
                              ]
                          }
                      ],
                  }]
6259471f   梁灏   support Modal
130
              }
7bafe9d9   梁灏   fixes #4453 #4480...
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
          },
          methods: {
              ok () {
  //                this.$Message.info('Clicked ok');
              },
              cancel () {
  //                this.$Message.info('Clicked cancel');
              },
              openMessage () {
                  this.$Message.info({
                      content: 'hello world',
                      duration: 2
                  });
              },
              handleSpinShow () {
                  this.$Spin.show();
              },
6259471f   梁灏   support Modal
148
149
150
          }
      }
  </script>