Notice 消息通知

... 2021-7-29 Less than 1 minute

# Notice 消息通知

Tips

2.2.0+

<el-tabs v-model="activeName">
  <el-tab-pane label="邮件(1)" name="first"></el-tab-pane>
  <el-tab-pane label="消息(2)" name="second"></el-tab-pane>
  <el-tab-pane label="通知" name="third"></el-tab-pane>
  <el-tab-pane label="计划" name="fourth"></el-tab-pane>
</el-tabs>
 <avue-notice @click="handleClick" :data="data" :option="option" @page-change="pageChange"></avue-notice>
<script>
let list = [{
    img: 'https://avuejs.com/images/logo-bg.jpg',
    title: '史蒂夫·乔布斯 关注了你',
    subtitle: '05-08 15:08',
    tag: '已经开始',
    status: 0
  }, {
    img: 'https://avuejs.com/images/logo-bg.jpg',
    title: '斯蒂夫·沃兹尼亚克 关注了你',
    subtitle: '05-08 15:08',
    tag: '未开始',
    status: 1
  }, {
    img: 'https://avuejs.com/images/logo-bg.jpg',
    title: '乔纳森·伊夫 关注了你',
    subtitle: '05-08 15:08',
    tag: '有警告',
    status: 2
  }, {
    img: 'https://avuejs.com/images/logo-bg.jpg',
    title: '蒂姆·库克 关注了你',
    subtitle: '05-08 15:08',
    status: 3,
    tag: '有错误'
  }, {
    img: 'https://avuejs.com/images/logo-bg.jpg',
    title: '比尔·费尔南德斯 关注了你',
    subtitle: '05-08 15:08',
    status: 4,
    tag: '已完成'
  }]
export default {
  data() {
      return {
        activeName:'first',
        option: {
          props: {
            img: 'img',
            title: 'title',
            subtitle: 'subtitle',
            tag: 'tag',
            status: 'status'
          },
        },
        data: list,
      }
    },
    created() {

    },
    methods: {
      handleClick(item){
        this.$message.success(JSON.stringify(item))
      },
      pageChange(page, done) {
        setTimeout(() => {
          this.$message.success('页码' + page)
          this.data = this.data.concat(list);
          done();
        }, 1000)

      },
    }
}
</script>

1
2
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
Expand Copy
Last update: July 29, 2021 14:59
Contributors: smallwei
您正在浏览基于 Vue 2.x 的 Avue 文档; 点击这里 查看 Vue 3.x 的升级版本