Documentation ¶
Index ¶
- Variables
- func Alert(args ...any) js.Value
- func AppendStyleElement(css string)
- func BrowserRun(entry func())
- func CreateEffect(fn func())
- func CreateSignal[T any](input T) (func() T, func(T))
- func CreateSignalEffect(signal any, event func(v any))
- func Dispatch(event string)
- func DispatchInput(args ...any)
- func GetClientX(e js.Value) float64
- func GetClientY(e js.Value) float64
- func GetEventVal(event js.Value) any
- func IsAndroid() bool
- func IsArray(i any) bool
- func IsDev() bool
- func IsIOS() bool
- func IsIpv4(ip string) bool
- func IsPhone() bool
- func IsSmall() bool
- func IsWechat() bool
- func JsFunc(fn func()) js.Func
- func ListenResize(f func())
- func NewFunction(args ...any) js.Value
- func RandomAttr() (string, string)
- func ScrollTo(top, left int)
- func SetInterval(fn func(), t int) int
- func SetTimeout(fn func(), t int) int
- func ToList(target js.Value) []js.Value
- func ToMap(target js.Value) map[string]js.Value
- func ToMapString(target js.Value) map[string]string
- func UserAgent() string
- type BoundingClientRect
- type Ele
- func Article() *Ele
- func Aside() *Ele
- func Button() *Ele
- func Code() *Ele
- func CreateElement(tag string) *Ele
- func CreateTextNode(str string) *Ele
- func Dd() *Ele
- func Div(text ...[]any) *Ele
- func Dt() *Ele
- func Footer() *Ele
- func For[T any](getList func() []T, render func(T, int) *Ele) *Ele
- func Form() *Ele
- func GetElementById(id string) *Ele
- func H1() *Ele
- func H2() *Ele
- func H3() *Ele
- func H4() *Ele
- func H5() *Ele
- func H6() *Ele
- func HPoint() *Ele
- func Header() *Ele
- func I() *Ele
- func If(check func() bool, render func() *Ele) *Ele
- func IfElse(check func() bool, ifRender func() *Ele, elseRender func() *Ele) *Ele
- func Iframe() *Ele
- func Input() *Ele
- func Kbd() *Ele
- func Label() *Ele
- func Li() *Ele
- func Link() *Ele
- func Mark() *Ele
- func Menu() *Ele
- func Meta() *Ele
- func Nav() *Ele
- func Ol() *Ele
- func P() *Ele
- func Script() *Ele
- func Section() *Ele
- func Select() *Ele
- func Span() *Ele
- func Strong() *Ele
- func Style() *Ele
- func Svg() *Ele
- func Table() *Ele
- func Td() *Ele
- func Template() *Ele
- func Textarea() *Ele
- func Th() *Ele
- func Tr() *Ele
- func Ul() *Ele
- func (target *Ele) Append(children ...any) *Ele
- func (target *Ele) Attr(name string, val any) *Ele
- func (target *Ele) Blur() *Ele
- func (target *Ele) ChildElementCount() int
- func (target *Ele) Class(val any) *Ele
- func (target *Ele) ClassListAdd(css string) *Ele
- func (target *Ele) ClassListContains(css string) bool
- func (target *Ele) ClassListRemove(key string) *Ele
- func (target *Ele) ClassListRemoveText(key string) *Ele
- func (target *Ele) ClassListReplace(key, css string) *Ele
- func (target *Ele) Closest(selector string) *Ele
- func (target *Ele) Contains(ele *Ele) bool
- func (target *Ele) CssText(val string) *Ele
- func (target *Ele) Dispatch(event string)
- func (target *Ele) DispatchInput(event string)
- func (target *Ele) FirstElementChild() *Ele
- func (target *Ele) Focus() *Ele
- func (target *Ele) GetAttr(name string) string
- func (target *Ele) GetBoundingClientRect() BoundingClientRect
- func (target *Ele) GetChild(num int) *Ele
- func (target *Ele) GetClass() string
- func (target *Ele) GetComputedStyle() js.Value
- func (target *Ele) GetElementById(q string) *Ele
- func (target *Ele) GetHeight() float64
- func (target *Ele) GetId() string
- func (target *Ele) GetInnerHTML() string
- func (target *Ele) GetInnerText() string
- func (target *Ele) GetName() string
- func (target *Ele) GetOffsetLeft() float64
- func (target *Ele) GetOffsetTop() float64
- func (target *Ele) GetPlaceholder() string
- func (target *Ele) GetSrc() string
- func (target *Ele) GetStyle(k string) string
- func (target *Ele) GetTagName() string
- func (target *Ele) GetText() string
- func (target *Ele) GetType() string
- func (target *Ele) GetValue() string
- func (target *Ele) GetValueBool() bool
- func (target *Ele) GetWidth() float64
- func (target *Ele) HasAttr(name string) bool
- func (target *Ele) Id(val any) *Ele
- func (target *Ele) InnerHTML(val any) *Ele
- func (target *Ele) InnerText(val any) *Ele
- func (target *Ele) InputMode(val any) *Ele
- func (target *Ele) InsertAdjacentElement(position string, ele *Ele) *Ele
- func (target *Ele) LastElementChild() *Ele
- func (target *Ele) Listen(key string, fn func(event js.Value)) *Ele
- func (target *Ele) ListenCallback(key string, fn func(event js.Value)) func()
- func (target *Ele) Max(val any) *Ele
- func (target *Ele) MaxLength(val any) *Ele
- func (target *Ele) Min(val any) *Ele
- func (target *Ele) MinLength(val any) *Ele
- func (target *Ele) Name(val any) *Ele
- func (target *Ele) NextElementSibling() *Ele
- func (target *Ele) On(key string, fn func(event js.Value)) *Ele
- func (target *Ele) OnChange(fn func(e *Ele)) *Ele
- func (target *Ele) OnClick(fn func()) *Ele
- func (target *Ele) OnInput(fn func(e *Ele)) *Ele
- func (target *Ele) OnMount(fn func()) *Ele
- func (target *Ele) OnMouseCancel(fn func(e *Ele)) *Ele
- func (target *Ele) OnMouseDown(fn func(e *Ele)) *Ele
- func (target *Ele) OnMouseEnter(fn func(e *Ele)) *Ele
- func (target *Ele) OnMouseMove(fn func(e *Ele)) *Ele
- func (target *Ele) OnMouseUp(fn func(e *Ele)) *Ele
- func (target *Ele) OnRemove(fn func()) *Ele
- func (target *Ele) OnSubmit(fn func(ele *Ele)) *Ele
- func (target *Ele) OnTouchCancel(fn func(e *Ele)) *Ele
- func (target *Ele) OnTouchDown(fn func(e *Ele)) *Ele
- func (target *Ele) OnTouchMove(fn func(e *Ele)) *Ele
- func (target *Ele) OnTouchUp(fn func(e *Ele)) *Ele
- func (target *Ele) ParentElement() *Ele
- func (target *Ele) Placeholder(val any) *Ele
- func (target *Ele) QuerySelector(q string) *Ele
- func (target *Ele) QuerySelectorAll(q string) []*Ele
- func (target *Ele) QuerySelectorAllRemove(q string)
- func (target *Ele) Ref(fn func(*Ele)) *Ele
- func (target *Ele) Remove()
- func (target *Ele) RemoveAttr(val string) *Ele
- func (target *Ele) RemoveChild(val *Ele) *Ele
- func (target *Ele) ReplaceChild(next *Ele, old *Ele) *Ele
- func (target *Ele) ReplaceWith(next *Ele) *Ele
- func (target *Ele) SetKV(k string, v any) *Ele
- func (target *Ele) SetValueAndDispatch(val, eventName any) *Ele
- func (target *Ele) Src(val any) *Ele
- func (target *Ele) Style(k string, val any) *Ele
- func (target *Ele) StyleMap(val any) *Ele
- func (target *Ele) Text(val any) *Ele
- func (target *Ele) Type(val any) *Ele
- func (target *Ele) Val(val any) *Ele
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Window = &Ele{Value: js.Global()} Location = &Ele{Value: js.Global().Get("location")} Document = &Ele{Value: js.Global().Get("document")} Body = &Ele{Value: js.Global().Get("document").Get("body")} Head = &Ele{Value: js.Global().Get("document").Get("head")} Promise = js.Global().Get("promise") Proxy = js.Global().Get("Proxy") Array = js.Global().Get("Array") String = js.Global().Get("String") Number = js.Global().Get("Number") Object = js.Global().Get("Object") Event = js.Global().Get("Event") InputEvent = js.Global().Get("InputEvent") MutationObserver = js.Global().Get("MutationObserver") )
View Source
var Console = consoleObj{Value: js.Global().Get("window").Get("console")}
View Source
var Constant = struct { PreventDefault string StopPropagation string BeforeBegin string Afterbegin string Beforeend string Afterend string }{ PreventDefault: "preventDefault", StopPropagation: "stopPropagation", BeforeBegin: "beforebegin", Afterbegin: "afterbegin", Beforeend: "beforeend", Afterend: "afterend", }
View Source
var Math = mathObj{Value: js.Global().Get("window").Get("Math")}
Functions ¶
func AppendStyleElement ¶
func AppendStyleElement(css string)
func BrowserRun ¶
func BrowserRun(entry func())
func CreateEffect ¶
func CreateEffect(fn func())
func CreateSignal ¶
func CreateSignal[T any](input T) (func() T, func(T))
func CreateSignalEffect ¶
func DispatchInput ¶
func DispatchInput(args ...any)
func GetClientX ¶
func GetClientY ¶
func GetEventVal ¶
func ListenResize ¶
func ListenResize(f func())
func NewFunction ¶
func RandomAttr ¶
func SetInterval ¶
func SetTimeout ¶
Types ¶
type BoundingClientRect ¶
type Ele ¶
func CreateElement ¶
func CreateTextNode ¶
func GetElementById ¶
func (*Ele) ChildElementCount ¶
func (*Ele) ClassListAdd ¶
func (*Ele) ClassListContains ¶
func (*Ele) ClassListRemove ¶
func (*Ele) ClassListRemoveText ¶
func (*Ele) ClassListReplace ¶
func (*Ele) DispatchInput ¶
func (*Ele) FirstElementChild ¶
func (*Ele) GetBoundingClientRect ¶
func (target *Ele) GetBoundingClientRect() BoundingClientRect
func (*Ele) GetComputedStyle ¶
func (*Ele) GetElementById ¶
func (*Ele) GetInnerHTML ¶
func (*Ele) GetInnerText ¶
func (*Ele) GetOffsetLeft ¶
func (*Ele) GetOffsetTop ¶
func (*Ele) GetPlaceholder ¶
func (*Ele) GetTagName ¶
func (*Ele) GetValueBool ¶
func (*Ele) InsertAdjacentElement ¶
func (*Ele) LastElementChild ¶
func (*Ele) ListenCallback ¶
func (*Ele) NextElementSibling ¶
func (*Ele) OnClick ¶
OnClick 为了移动端更快的点击响应,OnClick 事件区分了移动端和桌面端的实现,若在开发环境从移动端切换到桌面端,会遇到点击无响应的Bug,由于这种情况仅限于开发者,所以为了更少的事件判断,不做相关兼容
func (*Ele) OnMouseCancel ¶
func (*Ele) OnMouseDown ¶
func (*Ele) OnMouseEnter ¶
func (*Ele) OnMouseMove ¶
func (*Ele) OnTouchCancel ¶
func (*Ele) OnTouchDown ¶
func (*Ele) OnTouchMove ¶
func (*Ele) ParentElement ¶
func (*Ele) Placeholder ¶
func (*Ele) QuerySelector ¶
func (*Ele) QuerySelectorAll ¶
func (*Ele) QuerySelectorAllRemove ¶
func (*Ele) RemoveAttr ¶
func (*Ele) RemoveChild ¶
func (*Ele) ReplaceWith ¶
func (*Ele) SetValueAndDispatch ¶
Click to show internal directories.
Click to hide internal directories.