Blame view

examples/routers/notice.vue 3.65 KB
be0769d4   Rijn   added move up tra...
1
  <template>
e8e1677b   Aresn   Message & Notice ...
2
3
      <div>
          <p>带描述信息</p>
b24be35a   zhigang.li   make Message and ...
4
          <Button @click="normal(false)">普通</Button>
36e46e5a   梁灏   update Notice style
5
          <Button @click="normal(true)">普通</Button>
e8e1677b   Aresn   Message & Notice ...
6
          <Button @click="info(false)">消息</Button>
36e46e5a   梁灏   update Notice style
7
          <Button @click="info(true)">消息</Button>
e8e1677b   Aresn   Message & Notice ...
8
9
10
          <Button @click="success(false)">成功</Button>
          <Button @click="warning(false)">警告</Button>
          <Button @click="error(false)">错误</Button>
efc65a34   zhigang.li   fixed bug of noti...
11
          <Button @click="testRender()">render</Button>
e8e1677b   Aresn   Message & Notice ...
12
13
14
15
16
          <p>仅标题</p>
          <Button @click="info(true)">消息</Button>
          <Button @click="success(true)">成功</Button>
          <Button @click="warning(true)">警告</Button>
          <Button @click="error(true)">错误</Button>
1c82a9ab   Lawrence Lee   bugfix: notice & ...
17
          <Button @click="destroy()">销毁</Button>
e8e1677b   Aresn   Message & Notice ...
18
      </div>
be0769d4   Rijn   added move up tra...
19
20
21
22
  </template>
  <script>
      export default {
          methods: {
b24be35a   zhigang.li   make Message and ...
23
24
25
26
27
              normal (nodesc) {
                  this.$Notice.open({
                      title: 'google',
                      duration: 0,
                      desc: nodesc ? '' : '这里是通知描述这里,是通知描述这里是通知描述这里,是通知描述这里,是通知描述这里是通知描述这里是通知描述',
36e46e5a   梁灏   update Notice style
28
29
30
  //                    render (h) {
  //                        return h('span', {}, 'sdsdfsdf');
  //                    }
b24be35a   zhigang.li   make Message and ...
31
32
                  });
              },
e8e1677b   Aresn   Message & Notice ...
33
34
              info (nodesc) {
                  this.$Notice.info({
36e46e5a   梁灏   update Notice style
35
                       title: '这是通知标题',
b24be35a   zhigang.li   make Message and ...
36
37
                      duration: 0,
                      desc: nodesc ? '' : '这里是通知描述这里,是通知描述这里是通知描述这里,是通知描述这里,是通知描述这里是通知描述这里是通知描述',
36e46e5a   梁灏   update Notice style
38
39
40
  //                    render (h) {
  //                        return h('span', {}, 'sdsdfsdf');
  //                    }
e8e1677b   Aresn   Message & Notice ...
41
42
                  });
              },
3f7a5f1a   zhigang.li   udpate notice
43
              success () {
e8e1677b   Aresn   Message & Notice ...
44
45
                  this.$Notice.success({
                      title: '这是通知标题',
3f7a5f1a   zhigang.li   udpate notice
46
47
48
49
50
51
52
53
54
                      desc: '当你定义了render之后,这个描述会被覆盖',
                      render: h => {
                          return h('span', {}, [
                              '这是',
                              h('Button', {props: {type: 'text'}}, 'render'),
                              '函数渲染的'
                          ]);
                      },
                      duration: 0
e8e1677b   Aresn   Message & Notice ...
55
56
57
58
59
                  });
              },
              warning (nodesc) {
                  this.$Notice.warning({
                      title: '这是通知标题',
efc65a34   zhigang.li   fixed bug of noti...
60
                      desc: nodesc ? '' : '这里是通知描述这里,是通知描述这里是通知描述这里,是通知描述这里,是通知描述这里是通知描述这里是通知描述',
e8e1677b   Aresn   Message & Notice ...
61
62
63
64
65
66
                  });
              },
              error (nodesc) {
                  this.$Notice.error({
                      title: '这是通知标题',
                      desc: nodesc ? '' : '这里是通知描述这里,是通知描述这里是通知描述这里,是通知描述这里,是通知描述这里是通知描述这里是通知描述'
833501a4   梁灏   support Notice
67
                  });
1c82a9ab   Lawrence Lee   bugfix: notice & ...
68
              },
efc65a34   zhigang.li   fixed bug of noti...
69
70
71
72
73
74
75
76
77
78
79
80
81
82
              testRender () {
                  this.$Notice.info({
                      title: '这是通知标题',
                      duration: 0,
                      // desc: '当你定义了render之后,这个描述会被覆盖',
                      render: h => {
                          return h('span', {}, [
                              '这是',
                              h('Button', {props: {type: 'text'}}, 'render'),
                              '函数渲染的'
                          ]);
                      },
                  });
              },
1c82a9ab   Lawrence Lee   bugfix: notice & ...
83
84
              destroy () {
                  this.$Notice.destroy();
be0769d4   Rijn   added move up tra...
85
              }
be0769d4   Rijn   added move up tra...
86
87
88
          }
      }
  </script>