1.0.0 • Published 5 years ago
ele-modals v1.0.0
ele-modal
一、使用方式
1、安装
npm install ele-modal 或者 yarn add ele-modal
2、在项目中的
main.js
文件中引入import EleTables from "ele-modal" import "ele-modal/lib/ele-modal.css" Vue.use(EleTables)
3、组件中使用
<template> <div id="app"> <ele-modal v-model="visible" :confirmFunc="confirmBtn" title="新增"> <template slot="modal-body"> 内容区域 </template> </ele-modal> </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 | 标题 | 空 |
1.0.0
5 years ago