Skip to content

Commit

Permalink
fixed dynamic attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
crisward committed Jan 17, 2025
1 parent a020358 commit 412b3b3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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){
Expand Down Expand Up @@ -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(){
Expand Down Expand Up @@ -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
}
}
}
Expand Down

0 comments on commit 412b3b3

Please sign in to comment.