0.0.5 • Published 7 years ago

element-dialog2 v0.0.5

Weekly downloads
1
License
ISC
Repository
github
Last release
7 years ago

element-dialog2

an extension of element-dialog that allow you to use it nested

aaa

versions

  • 0.0.5
    open and close envents won't be $emited repeated.
  • 0.0.4
    currently vue@2.3.0+ with element-ui@1.3.0+ work correct.

useage

  • install
    npm install element-dialog2 --save
  • use
    //common 
    var ElDialog2 = require('element-dialog2');
    Vue.component(ElDialog2.name,ElDialog2);
    //import form source
    import ElDialog2 from 'element-dialog2/src/index.js';
    Vue.component(ElDialog2.name,ElDialog2)
  • code
    <el-dialog2 title="this is title"  v-if="showed" v-model="showed"
        v-on:close="handleClose">
        <span>code of $slots.default</span>
        <div slot="footer">
            code of $slots.footer
        </div>
    </el-dialog2>
    <el-dialog2   v-if="showed" v-model="showed"
        v-on:close="handleClose">
        <div slot="title">
            this is title
        </div>
        <span>code of $slots.default</span>
        <div slot="footer">
            code of $slots.footer
        </div>
    </el-dialog2>

Attributes

AttributeCompare ElementDescriptionTypeAccepted ValuesDefault
titlesametitle of Dialog. Can also be passed with a named slot (see the following table)string
sizesamesize of Dialogstringtiny/small/large/fullsmall
topsamevalue for top of Dialog CSS, works when size is not fullstring15%
modalsamewhether a mask is displayedbooleantrue
modal-append-to-bodysamewhether to append modal to body element. If false, the modal will be appended to Dialog's parent elementbooleantrue
lock-scrollsamewhether scroll of body is disabled while Dialog is displayedbooleantrue
custom-classsamecustom class names for Dialogstring
close-on-click-modaldefault value diffrentwhether the Dialog can be closed by clicking the maskbooleanfalse
close-on-press-escapesamewhether the Dialog can be closed by pressing ESCbooleantrue
show-closesamewhether to show a close buttonbooleantrue
before-closesamebeforeclose(close)Functionnull
  • beforeClose new in element-ui@1.3.0+
        beforeClose(close){
            if(...){
                // hook of close
                close();
            }
        }

Slot

NameDescription
content of Dialog
titlecontent of the Dialog title
footercontent of the Dialog footer
0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago