//go:build js && wasm package ultraviolet import ( "syscall/js" ) type ImageComponentWeb struct { node js.Value view View change bool path string } func NewImageComponentWeb(view View) *ImageComponentWeb { return &ImageComponentWeb{ view: view, change: true, path: "", } } // Component func (this *ImageComponentWeb) Build(parent Component) { this.node = WebBuildImg( this.node, parent, this.view, this.path, ) } func (this *ImageComponentWeb) Invalidate() bool { result := this.change this.change = false return result } func (this *ImageComponentWeb) Clean() { WebCleanChildren(this.node) } // JS func (this *ImageComponentWeb) Node() js.Value { return this.node } // ComponentImage func (this *ImageComponentWeb) SetPath(path string) { this.path = path }