1 Star 0 Fork 50

绿树白云 / avue-doc

forked from 鹏鹏 / avue-doc 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
notice.md 3.42 KB
一键复制 编辑 原始数据 按行查看 历史
smallwei 提交于 2020-05-30 20:51 . init docs
<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>

Notice 消息通知

:::tip 2.2.0+ ::::

:::demo

<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>

:::

马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/greentreecloud/avue-doc.git
git@gitee.com:greentreecloud/avue-doc.git
greentreecloud
avue-doc
avue-doc
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891