Blame view

examples/routers/message.vue 1.47 KB
7c15ac9e   梁灏   add Message compo...
1
  <template>
21dad188   梁灏   prevent dispatch ...
2
      <div>
e0bd31a6   Aresn   update Message
3
          <i-button @click.native="info">显示普通提示</i-button>
21dad188   梁灏   prevent dispatch ...
4
5
6
          <i-button @click.native="success">显示成功提示</i-button>
          <i-button @click.native="warning">显示警告提示</i-button>
          <i-button @click.native="error">显示错误提示</i-button>
55b608a6   Lawrence Lee   bugfix on .destroy
7
          <i-button @click.native="destroy">销毁提示</i-button>
21dad188   梁灏   prevent dispatch ...
8
      </div>
7c15ac9e   梁灏   add Message compo...
9
10
  </template>
  <script>
7c15ac9e   梁灏   add Message compo...
11
      export default {
7c15ac9e   梁灏   add Message compo...
12
          methods: {
e0bd31a6   Aresn   update Message
13
14
15
16
17
18
19
20
21
22
23
              info () {
  //                this.$Message.info('这是一条普通提示');
                  this.$Message.success({
                      content: '这是一条普通提示2',
                      duration: 500,
                      onClose () {
                          console.log(123)
                      },
                      closable: true
                  })
              },
21dad188   梁灏   prevent dispatch ...
24
              success () {
a77eaa5c   梁灏   update
25
26
27
28
                  this.$Message.success({
                      content: '这是一条成功的提示',
                      duration: 4
                  });
21dad188   梁灏   prevent dispatch ...
29
30
31
32
33
34
              },
              warning () {
                  this.$Message.warning('这是一条警告的提示');
              },
              error () {
                  this.$Message.error('对方不想说话,并且向你抛出了一个异常');
55b608a6   Lawrence Lee   bugfix on .destroy
35
36
37
              },
              destroy () {
                  this.$Message.destroy();
7c15ac9e   梁灏   add Message compo...
38
              }
a77eaa5c   梁灏   update
39
40
41
42
43
44
          },
          mounted () {
              this.$Message.config({
                  top: 50,
                  duration: 3
              });
7c15ac9e   梁灏   add Message compo...
45
46
          }
      }
e1134de2   jingsam   not bundle vue in...
47
  </script>