1.0.1 • Published 6 years ago
ele-dialog v1.0.1
ele-dialog
一、使用方式
1、安装
npm install ele-dialog 或者 yarn add ele-dialog
2、在项目中的
main.js
文件中引入import EleDialog from "ele-dialog" import "ele-dialog/lib/ele-dialog.css" Vue.use(EleDialog)
3、组件中使用
<template> <div id="app"> <ele-dialog v-model="visible" :confirmFunc="confirmBtn" title="新增"> <template slot="dialog-body"> 内容区域 </template> </ele-dialog> </div> </template> <script> export default { name: "app", data() { return { visible: false } }, methods: { openModel() { this.visible = true }, confirmBtn() { this.visible = false console.log("提交,回调") } } } </script>
二、主要的API
参数 | 类型 | 说明 | 默认值 |
---|---|---|---|
confirmFunc | Function | 提交回调 | 空 |
title | String | 标题 | 空 |