GithubHelp home page GithubHelp logo

Comments (4)

Leopoldthecoder avatar Leopoldthecoder commented on April 25, 2024

我这边试了一下,没有报错。所以请提供你的 vue 版本、element 版本,以及使用 Notification 的代码片段

from element.

hizhengfu avatar hizhengfu commented on April 25, 2024

相关资源版本:

"element-ui": "^1.0.0-rc.3",
    "vue": "^2.0.0-rc.6",
    "vue-resource": "^1.0.1",
    "vue-router": "^2.0.0-rc.5"

可能是我这用法的问题

import { Notification } from 'element-ui';

在ajax中增加了一个全局的逻辑,如果返回数据有需要提醒的提示信息就显示出来,不需要界面单独处理

Vue.http.interceptors.push((request, next) => {
            next((response) => {
            var data = response.data;
            if (data && data.message) {
                Notification({
                    title: '通知',
                    duration: 8,
                    message: data.message,
                    type: data.type || 'info'
                });
            }
        });
    }
});

from element.

Leopoldthecoder avatar Leopoldthecoder commented on April 25, 2024

duration 的单位是毫秒,改成 8000 再试试

from element.

hizhengfu avatar hizhengfu commented on April 25, 2024

ok了,这个没仔细看文档,以为和vue-desktop是一致的。感谢

from element.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.