1.0.1 • Published 5 years ago

ele-dialog v1.0.1

Weekly downloads
1
License
MIT
Repository
-
Last release
5 years ago

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

参数类型说明默认值
confirmFuncFunction提交回调
titleString标题