mirror of
https://github.com/ElemeFE/element.git
synced 2025-12-19 12:04:02 +08:00
Message: add closeOnHashChange, update docs
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
<div class="el-message-box__content" v-if="message !== ''">
|
||||
<div class="el-message-box__status" :class="[ typeClass ]"></div>
|
||||
<div class="el-message-box__message" :style="{ 'margin-left': typeClass ? '50px' : '0' }">
|
||||
<slot><p>{{ message }}</p></slot>
|
||||
<slot><p v-html="message"></p></slot>
|
||||
</div>
|
||||
<div class="el-message-box__input" v-show="showInput">
|
||||
<el-input v-model="inputValue" @keyup.enter.native="handleAction('confirm')" :placeholder="inputPlaceholder" ref="input"></el-input>
|
||||
@@ -75,6 +75,9 @@
|
||||
},
|
||||
closeOnPressEscape: {
|
||||
default: true
|
||||
},
|
||||
closeOnHashChange: {
|
||||
default: true
|
||||
}
|
||||
},
|
||||
|
||||
@@ -210,6 +213,18 @@
|
||||
}
|
||||
},
|
||||
|
||||
mounted() {
|
||||
if (this.closeOnHashChange) {
|
||||
window.addEventListener('hashchange', this.close);
|
||||
}
|
||||
},
|
||||
|
||||
beforeDestroy() {
|
||||
if (this.closeOnHashChange) {
|
||||
window.removeEventListener('hashchange', this.close);
|
||||
}
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
uid: 1,
|
||||
|
||||
Reference in New Issue
Block a user