add destroy() for message component

add destroy() for message component
This commit is contained in:
梁灏 2016-09-19 17:12:12 +08:00
parent 47e5839630
commit d367168798
3 changed files with 10 additions and 1 deletions

View file

@ -89,5 +89,10 @@ export default {
if (options.duration) {
defaultDuration = options.duration;
}
},
destroy () {
let instance = getMessageInstance();
messageInstance = null;
instance.destroy();
}
}

View file

@ -4,6 +4,7 @@
<Button @click="error">error</Button>
<Button @click="warning">warning</Button>
<Button @click="loading">手动消失</Button>
<Button @click="destroy">destroy</Button>
</template>
<script>
import { Message, Button } from 'iview';
@ -45,6 +46,9 @@
const hide = Message.loading('我是loading', 0);
setTimeout(hide, 5000);
},
destroy () {
Message.destroy();
}
},
ready () {

View file

@ -1,6 +1,6 @@
{
"name": "iview",
"version": "0.0.8",
"version": "0.0.9",
"title": "iView",
"description": "A high quality UI components Library with Vue.js",
"homepage": "http://www.iviewui.com",