Skip to content

Commit

Permalink
feat(popup): 修复在组件上使用class属性和style属性,会有vue警告(更新snapshot) (#1135)
Browse files Browse the repository at this point in the history
  • Loading branch information
aomnisz authored Oct 23, 2023
1 parent 9381cc4 commit 7c8dadd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
6 changes: 0 additions & 6 deletions src/popup/__test__/__snapshots__/demo.test.jsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ exports[`Popup > Popup baseVue demo works fine 1`] = `
<teleport-stub
data-v-70969ba8=""
disabled="false"
style="padding: 100px;"
to="[object HTMLBodyElement]"
>
<div
Expand Down Expand Up @@ -139,7 +138,6 @@ exports[`Popup > Popup customCloseVue demo works fine 1`] = `
</button>
<teleport-stub
disabled="false"
style="width: 240px; height: 240px;"
to="[object HTMLBodyElement]"
>
<div
Expand Down Expand Up @@ -303,7 +301,6 @@ exports[`Popup > Popup mobileVue demo works fine 1`] = `
<teleport-stub
data-v-70969ba8=""
disabled="false"
style="padding: 100px;"
to="[object HTMLBodyElement]"
>
<div
Expand Down Expand Up @@ -373,7 +370,6 @@ exports[`Popup > Popup mobileVue demo works fine 1`] = `
<teleport-stub
data-v-099d70a8=""
disabled="false"
style="height: 258px;"
to="[object HTMLBodyElement]"
>
<div
Expand Down Expand Up @@ -440,7 +436,6 @@ exports[`Popup > Popup mobileVue demo works fine 1`] = `
</button>
<teleport-stub
disabled="false"
style="width: 240px; height: 240px;"
to="[object HTMLBodyElement]"
>
<div
Expand Down Expand Up @@ -499,7 +494,6 @@ exports[`Popup > Popup withTitleVue demo works fine 1`] = `
<teleport-stub
data-v-099d70a8=""
disabled="false"
style="height: 258px;"
to="[object HTMLBodyElement]"
>
<div
Expand Down
3 changes: 2 additions & 1 deletion src/popup/popup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<teleport v-if="!destroyOnClose || wrapperVisbile" :to="to" :disabled="!to">
<t-overlay v-bind="overlayProps" :visible="innerVisible && showOverlay" @click="handleOverlayClick" />
<transition :name="contentTransitionName" @after-enter="afterEnter" @after-leave="afterLeave">
<div v-show="innerVisible" :class="[name, $attrs.class, contentClasses]" :style="rootStyles">
<div v-show="innerVisible" :class="[name, $attrs.class, contentClasses]" :style="rootStyles" v-bind="$attrs">
<div v-if="closeBtnNode" :class="`${name}__close`" @click="handleCloseClick">
<t-node :content="closeBtnNode" />
</div>
Expand Down Expand Up @@ -32,6 +32,7 @@ let lockTimes = 0;
export default defineComponent({
name,
components: { TNode, TOverlay },
inheritAttrs: false,
props: popupProps,
emits: ['open', 'close', 'opened', 'closed', 'visible-change', 'update:visible', 'update:modelValue'],
setup(props, context) {
Expand Down

0 comments on commit 7c8dadd

Please sign in to comment.