From 412b3b35de02317eb3f464fb0958897b4f8ae63e Mon Sep 17 00:00:00 2001 From: Cris Ward Date: Fri, 17 Jan 2025 22:37:35 +0000 Subject: [PATCH] fixed dynamic attributes --- index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 00879de..4e3642a 100644 --- a/index.js +++ b/index.js @@ -27,6 +27,7 @@ export default function(opts){ constructor() { super(); this.slotcount = 0 + this.props = {} let root = opts.shadow ? this.attachShadow({ mode: 'open' }) : this // link generated style if(opts.href && opts.shadow){ @@ -65,6 +66,7 @@ export default function(opts){ this.slotcount = Object.keys(slots).length props.$$slots = createSlots(slots) this.elem = mount(opts.component, { target: this._root, props:props }); + this.props = props } disconnectedCallback(){ @@ -131,7 +133,7 @@ export default function(opts){ attributeChangedCallback(name, oldValue, newValue) { if(this.elem && newValue!=oldValue){ - this.elem[name] = newValue + this.props[name] = newValue } } }