File tree Expand file tree Collapse file tree 2 files changed +55
-0
lines changed
Expand file tree Collapse file tree 2 files changed +55
-0
lines changed Original file line number Diff line number Diff line change 1+ /**
2+ * Created by Emmy on 3/5/2018.
3+ */
4+
5+ import { DIALOG_TYPES , CONFIRM_TYPES } from '../constants'
6+
7+ export default {
8+ computed : {
9+ cancelBtnDisabled ( ) {
10+ return ( this . options . window === DIALOG_TYPES . ALERT )
11+ } ,
12+ okBtnDisabled ( ) {
13+ return ( this . options . window === DIALOG_TYPES . CONFIRM )
14+ && ( this . options . type === CONFIRM_TYPES . HARD )
15+ && ( this . input !== this . options . verification )
16+ } ,
17+ leftBtnEnabled ( ) {
18+ return ( this . cancelBtnDisabled === false ) || ( this . options . reverse === true )
19+ } ,
20+ rightBtnEnabled ( ) {
21+ return ( this . cancelBtnDisabled === false ) || ( this . options . reverse === false )
22+ } ,
23+ leftBtnFocus ( ) {
24+ return ! this . isHardConfirm && ( this . options . reverse === true )
25+ } ,
26+ rightBtnFocus ( ) {
27+ return ! this . isHardConfirm && ( this . options . reverse === false )
28+ } ,
29+ leftBtnText ( ) {
30+ return this . options . reverse ? this . options . okText : this . options . cancelText
31+ } ,
32+ rightBtnText ( ) {
33+ return this . options . reverse ? this . options . cancelText : this . options . okText
34+ }
35+ }
36+ }
Original file line number Diff line number Diff line change 1+ /**
2+ * Created by Emmy on 3/5/2018.
3+ */
4+
5+ export default {
6+ computed : {
7+ messageHasTitle ( ) {
8+ let m = this . options . message
9+ return ( typeof m === 'object' && m !== null ) && m . title
10+ } ,
11+ messageTitle ( ) {
12+ return this . messageHasTitle ? this . options . message . title : null
13+ } ,
14+ messageBody ( ) {
15+ let m = this . options . message
16+ return ( typeof m === 'string' ) ? m : ( m . body || '' )
17+ }
18+ }
19+ }
You can’t perform that action at this time.
0 commit comments