`<el-hyphenated-attr-removal></el-hyphenated-attr-removal>`,
)
})
+
+ test('no unexpected mutation of the 1st argument', () => {
+ const Foo = {
+ name: 'Foo',
+ }
+
+ defineCustomElement(Foo, { shadowRoot: false })
+
+ expect(Foo).toEqual({
+ name: 'Foo',
+ })
+ })
})
*/
_createApp?: CreateAppFunction<Element>,
): VueElementConstructor {
- const Comp = defineComponent(options, extraOptions) as any
- if (isPlainObject(Comp)) extend(Comp, extraOptions)
+ let Comp = defineComponent(options, extraOptions) as any
+ if (isPlainObject(Comp)) Comp = extend({}, Comp, extraOptions)
class VueCustomElement extends VueElement {
static def = Comp
constructor(initialProps?: Record<string, any>) {