🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

vue-contentbox

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

vue-contentbox

借助vue.extend完成的消息提示框。

unpublished
latest
npmnpm
Version
1.0.3
Version published
Maintainers
1
Created
Source

vue-contentbox

借助vue.extend完成的消息提示框。

类似小程序或Uniapp的showToast和showModal,扩展在this(vue)上直接使用组件。

目前仅支持vue2.x

Install

  • npm安装
npm install vue-contentbox --save
  • yarn安装
yarn add vue-contentbox

Usage

  • 全局引入
//main.js
import {Toast,Modal} from "vue-contentbox";
Vue.prototype.$toast = Toast;
Vue.prototype.$modal = Modal;
  • 页面使用
//xxx.vue
this.$toast.info("Hello world");
this.$toast({
    type: "info",
    content: "Hello world"
})
this.$modal({
    content: "Hello world",
    success:(res)=>{
        if(res.confirm)
            console.log("OK");
        else
            console.log("Error");
    }
})

配置项

Toast

paramsvalueinfo
type[info,success,warning,error]选择其中之一
content""文本
durationdefalut:1000默认值1000/单位ms
closeFuncnull消失后触发

Modal

paramsvalueinfo
content""文本
successnull回调函数

Reference

MessageBox

More

Vue3待完成

Keywords

vue

FAQs

Package last updated on 16 Nov 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts