美文网首页
vue.js $Alert 全局通知组件

vue.js $Alert 全局通知组件

作者: 曹锦花 | 来源:发表于2019-08-22 20:12 被阅读0次

常规组件使用方法

<template>
    <Alert content="通知内容" :duration="3"></Alert>
</template>
<script>
    import Alert from '../components/alert.vue';
    
    export default {
        components: { Alert }
    }
</script>

$Alert 的调用

export default {
    methods: {
        showMessage () {
            this.$Alert({
                content: '通知内容',
                duration: 3
            });
        }
    }
}

相关文章

  • vue.js $Alert 全局通知组件

    常规组件使用方法 $Alert 的调用

  • 10.实战 4:全局提示组件——$Alert

    实战 4:全局提示组件——$Alert 有一种 Vue.js 组件,它不同于常规的组件,但组件结构本身很简单,比如...

  • vue组件之构建

    关键词:构建组件 引入vue.js* 全局组件 模板方式搭建 注册使用 注意 组件只能有一个根元素 全局组件代码一...

  • vue全局组件

    全局组件 组件 (Component) 是 Vue.js 最强大的功能之一。组件可以扩展 HTML 元素,封装可重...

  • 6.组件 ★

    1.组件(Component)是Vue.js最核心的功能。2.组件的注册有全局注册和局部注册两种方式。全局注册后,...

  • notification组件实现的流程

    1.流程总述 在我们用vue开发项目的时候,有些全局组件需要我们去全局声明,但类似于alert,message这种...

  • 组件

    组件是什么?组件是Vue.js最强大的功能之一,组件可扩展Html元素,封装可重用的代码。组件分为两大类:全局组件...

  • Vue.js组件

    Vue.js 组件 1、全局组件生成(所有的Vue实例都可以使用)语法构成:Vue.component(tagNa...

  • 使用Vue做一个简单的todo应用的三种方式

    1. 引用vue.js 2. 全局组件注册 3. vue-cli脚手架

  • react实现antd Notification组件

    antd有个Notification组件用于全局通知提醒, 现在用react实现一个相同的组件。 思考这个组件: ...

网友评论

      本文标题:vue.js $Alert 全局通知组件

      本文链接:https://www.haomeiwen.com/subject/mzbosctx.html