fix(rumtime-core): custom dom props should be cloned when cloning a hoisted DOM (#3080)

fix #3072
This commit is contained in:
HcySunYang
2021-03-25 22:21:57 +08:00
committed by GitHub
parent eb1fae63f9
commit 5dbe834858
2 changed files with 26 additions and 1 deletions

View File

@@ -0,0 +1,12 @@
import { nodeOps } from '../src/nodeOps'
describe('nodeOps', () => {
test('the _value property should be cloned', () => {
const el = nodeOps.createElement('input') as HTMLDivElement & {
_value: any
}
el._value = 1
const cloned = nodeOps.cloneNode!(el) as HTMLDivElement & { _value: any }
expect(cloned._value).toBe(1)
})
})