-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(vote): add vote component #INF-169 #458
Conversation
src/vote/vote.component.ts
Outdated
(this._classNames || []).forEach((value: string) => { | ||
this.renderer.removeClass(this._nativeElement, value); | ||
}); | ||
|
||
this._classNames = className; | ||
this._classNames.forEach((value: string) => { | ||
this.renderer.addClass(this._nativeElement, value); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个地方使用 UpdateHostClassService
他会自动做移除样式和追加样式的逻辑
} | ||
|
||
_setClassesByType() { | ||
const className = []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
最好设置一个变量 initialized,否则会在加载组件的时候调用这个逻辑很多次
src/vote/vote.component.ts
Outdated
templateUrl: './vote.component.html' | ||
}) | ||
export class ThyVoteComponent implements OnInit { | ||
private _nativeElement: any; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
可以使用 HTMLElement 类型
src/vote/vote.component.ts
Outdated
} | ||
|
||
@Input() | ||
set thyVoteType(value: ThyVoteType) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个改成 thyLayout
最好, 去掉 Vote
No description provided.