-
Notifications
You must be signed in to change notification settings - Fork 2
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
[gem] CSS state and js state #179
Labels
Comments
like emitter:
class MyElement extends HTMLElement {
@state state: StateFn<{a: number}> = { a: 1 }
} |
取消 这个方案不能继承,只有装饰器才能继承字段值 // 目前状态也不能继承 class My {
state = { }
mounted () {
this.setState()
}
} |
修改 js state: class My {
#state = createState<State>({ a: 2 })
render() {
this.#state.a;
this.#state({ a: 1 })
}
} 怎么让 devtools 读取?// 使用 internals css state 只适合用
|
mantou132
added a commit
that referenced
this issue
Aug 5, 2024
mantou132
added a commit
that referenced
this issue
Aug 5, 2024
mantou132
added a commit
that referenced
this issue
Aug 5, 2024
mantou132
added a commit
that referenced
this issue
Aug 5, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@state
确是要赋值的下面这个方案和 state 一样怎么保证类型:
The text was updated successfully, but these errors were encountered: