Skip to content

Commit

Permalink
fix: fix style of snackbar
Browse files Browse the repository at this point in the history
  • Loading branch information
BeADre committed Dec 24, 2020
1 parent 226bc04 commit 2858e3e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 19 deletions.
20 changes: 4 additions & 16 deletions packages/varlet-ui/src/snackbar-core/SnackbarCore.vue
Original file line number Diff line number Diff line change
@@ -1,31 +1,19 @@
<template>
<div
class="var-snackbar"
:style="{ pointerEvents: forbidClick ? 'auto' : 'none' }"
v-show="show"
>
<div class="var-snackbar" :style="{ pointerEvents: forbidClick ? 'auto' : 'none' }" v-show="show">
<div
:class="`var-snackbar__wrapper var-snackbar__wrapper-${position} var-elevation--4 ${
vertical ? 'var-snackbar__vertical' : ''
}`"
:style="snackbarStyle"
>
<div :class="`var-snackbar__content ${contentClass}`">
<var-loading
:type="loadingType"
:size="loadingSize"
v-if="type === 'loading'"
/>
<div :class="`var-snackbar__content${contentClass ? ` ${contentClass}` : ''}`">
<var-loading :type="loadingType" :size="loadingSize" v-if="type === 'loading'" />
<slot>
{{ content }}
</slot>
</div>
<div class="var-snackbar__action">
<var-button
type="primary"
size="small"
v-if="['success', 'error', 'info', 'warning'].includes(type)"
>
<var-button type="primary" size="small" v-if="['success', 'error', 'info', 'warning'].includes(type)">
{{ type }}
</var-button>
<slot name="action"></slot>
Expand Down
2 changes: 1 addition & 1 deletion packages/varlet-ui/src/snackbar-core/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const props = {
// 是否禁止滚动穿透
lockScroll: {
type: Boolean,
default: true,
default: false,
},
// 控制组件可见还是隐藏
show: {
Expand Down
4 changes: 2 additions & 2 deletions packages/varlet-ui/src/snackbar-core/snackbarCore.less
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
@import "../styles/common";

.var-transition-group {
position: absolute;
position: fixed;
left: 0;
right: 0;
top: 0;
Expand Down Expand Up @@ -68,7 +68,7 @@

&-snackbar-transition {
top: 0;

position: fixed;
.var-snackbar__wrapper {
position: relative;

Expand Down

0 comments on commit 2858e3e

Please sign in to comment.