component_web_root.go 615 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. //go:build js && wasm
  2. package ultraviolet
  3. import (
  4. "syscall/js"
  5. )
  6. type RootComponentWeb struct {
  7. node js.Value
  8. }
  9. func NewRootComponentWeb(view View) *RootComponentWeb {
  10. return &RootComponentWeb{
  11. node: WebBuildDivInternal(
  12. js.Value{},
  13. WebContent(),
  14. view,
  15. "",
  16. "",
  17. AbstractHandlers{},
  18. ),
  19. }
  20. }
  21. // Component
  22. func (this *RootComponentWeb) Build(parent Component) {
  23. // ...
  24. }
  25. func (this *RootComponentWeb) Invalidate() bool {
  26. return false
  27. }
  28. func (this *RootComponentWeb) Clean() {
  29. WebCleanChildren(this.node)
  30. }
  31. // JS
  32. func (this *RootComponentWeb) Node() js.Value {
  33. return this.node
  34. }