Skip to content

Commit

Permalink
fix: optimize function parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
yhy committed Jul 19, 2023
1 parent a228dc3 commit 09ad523
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,16 +210,18 @@ export class QuarkElement extends HTMLElement {
// 内部属性装饰器
protected static getStateDescriptor(name: string): () => PropertyDescriptor {
return (defaultValue?: any) => {
console.log(defaultValue, 'defaultValue')
let _value = defaultValue;
return {
get(this: QuarkElement): any {
return _value;
},
set(this: QuarkElement, value: string | boolean | null) {
const oldValue = _value
_value = value;
this._render();
if (isFunction(this.componentDidUpdate)) {
this.componentDidUpdate(name, _value,value);
this.componentDidUpdate(name, defaultValue,value);
}
},
configurable: true,
Expand Down

0 comments on commit 09ad523

Please sign in to comment.