update Message style

This commit is contained in:
梁灏 2018-06-25 20:56:43 +08:00
parent 14b1413aa1
commit 0069c7b150
2 changed files with 40 additions and 7 deletions

View file

@ -1,16 +1,45 @@
<template> <template>
<Button @click="loading">Display loading...</Button> <div>
<Button type="primary" @click="info">Display info prompt</Button>
<Button @click="success">Display success prompt</Button>
<Button @click="warning">Display warning prompt</Button>
<Button @click="error">Display error prompt</Button>
<Button @click="loading">Display loading...</Button>
<Button @click="closable">Display a closable message</Button>
</div>
</template> </template>
<script> <script>
export default { export default {
methods: { methods: {
info () {
this.$Message.info({
content: '这是一条普通的提示',
duration: 1000
});
},
success () {
this.$Message.success('This is a success tip');
},
warning () {
this.$Message.warning('This is a warning tip');
},
error () {
this.$Message.error('This is an error tip');
},
loading () { loading () {
const msg = this.$Message.loading({ const msg = this.$Message.loading({
content: 'Loading...', content: 'Loading...',
duration: 0 duration: 0
}); });
setTimeout(msg, 103000); setTimeout(msg, 3000);
}, },
closable () {
this.$Message.info({
content: 'Tips for manual closing',
duration: 1000,
closable: true
});
}
} }
} }
</script> </script>

View file

@ -2,7 +2,7 @@
@icon-prefix-cls: ~"@{css-prefix}icon"; @icon-prefix-cls: ~"@{css-prefix}icon";
.@{message-prefix-cls} { .@{message-prefix-cls} {
font-size: @font-size-small; font-size: @font-size-base;
position: fixed; position: fixed;
z-index: @zindex-message; z-index: @zindex-message;
width: 100%; width: 100%;
@ -70,9 +70,13 @@
} }
.@{icon-prefix-cls} { .@{icon-prefix-cls} {
margin-right: 8px; margin-right: 4px;
font-size: 14px; font-size: @font-size-large;
top: 1px; vertical-align: middle;
position: relative; }
&-custom-content{
span{
vertical-align: middle;
}
} }
} }