Skip to content

Commit

Permalink
fix: fix snackbar bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
BeADre committed Jan 7, 2021
1 parent cd082d1 commit 0f05496
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
5 changes: 2 additions & 3 deletions packages/varlet-ui/src/pull-refresh/PullRefresh.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
>
<var-icon :name="iconName" :transition="200" :class="iconClass" />
</div>
<slot></slot>
<slot />
</div>
</template>

Expand All @@ -36,7 +36,6 @@ export default defineComponent({
components: {
[Icon.name]: Icon,
},
inheritAttrs: false,
props,
setup(props) {
const freshNode: Ref<HTMLElement | null> = ref(null)
Expand Down Expand Up @@ -138,5 +137,5 @@ export default defineComponent({
</script>

<style lang="less">
@import './pull-refresh';
@import './pullRefresh';
</style>
3 changes: 2 additions & 1 deletion packages/varlet-ui/src/snackbar/core.less
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
transition: all 0.15s cubic-bezier(0, 0, 0.2, 1);

&__wrapper {
width: 256px;
display: flex;
border-radius: 4px;
color: hsla(0, 0%, 100%, 0.87);
Expand Down Expand Up @@ -59,7 +60,7 @@
}

&__action {
margin-right: 8px;
margin-right: 16px;
display: flex;
}

Expand Down
3 changes: 2 additions & 1 deletion packages/varlet-ui/src/snackbar/core.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,10 @@ export default defineComponent({
if (show) {
props.onOpen?.()
timer.value = setTimeout(() => {
props['onUpdate:show']?.()
props['onUpdate:show']?.(false)
}, props.duration)
} else if (show === false) {
clearTimeout(timer.value)
props.onClose?.()
}
}
Expand Down

0 comments on commit 0f05496

Please sign in to comment.