8000 fix(custom-element): avoid setting attr to null if it is removed by edison1105 · Pull Request #9012 · vuejs/core · GitHub
[go: up one dir, main page]

Skip to content

fix(custom-element): avoid setting attr to null if it is removed #9012

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Mar 16, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test: update test case
  • Loading branch information
edison1105 committed Aug 22, 2023
commit e1287fc568aa8bd83ca835da6ec8183de8b19e0b
3 changes: 2 additions & 1 deletion packages/runtime-dom/__tests__/customElement.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,11 @@ describe('defineCustomElement', () => {
expect(e.shadowRoot!.innerHTML).toBe('<div>three</div><div>two</div>')
expect(e.getAttribute('foo')).toBe('three')

e.foo = null
e.foo = undefined
await nextTick()
expect(e.shadowRoot!.innerHTML).toBe('<div></div><div>two</div>')
expect(e.hasAttribute('foo')).toBe(false)
expect(e.foo).toBe(undefined)

e.bazQux = 'four'
await nextTick()
Expand Down
0