w

package
v0.0.0-...-b5254e4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 8, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

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")
	Navigator        = js.Global().Get("navigator")
	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 Alert

func Alert(args ...any) js.Value

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 CreateSignalEffect(signal any, event func(v any))

func Dispatch

func Dispatch(event string)

func DispatchInput

func DispatchInput(args ...any)

func GetClientX

func GetClientX(e js.Value) float64

func GetClientY

func GetClientY(e js.Value) float64

func GetEventVal

func GetEventVal(event js.Value) any

func IsAndroid

func IsAndroid() bool

func IsArray

func IsArray(i any) bool

func IsDev

func IsDev() bool

func IsIOS

func IsIOS() bool

func IsIpv4

func IsIpv4(ip string) bool

func IsPhone

func IsPhone() bool

func IsSmall

func IsSmall() bool

func IsWechat

func IsWechat() bool

func JsFunc

func JsFunc(fn func()) js.Func

func ListenResize

func ListenResize(f func())

func NewFunction

func NewFunction(args ...any) js.Value

func RandomAttr

func RandomAttr() (string, string)

func ScrollTo

func ScrollTo(top, left int)

func SetInterval

func SetInterval(fn func(), t int) int

func SetTimeout

func SetTimeout(fn func(), t int) int

func ToList

func ToList(target js.Value) []js.Value

func ToMap

func ToMap(target js.Value) map[string]js.Value

func ToMapString

func ToMapString(target js.Value) map[string]string

func UserAgent

func UserAgent() string

Types

type BoundingClientRect

type BoundingClientRect struct {
	Bottom float64
	Height float64
	Left   float64
	Right  float64
	Top    float64
	Width  float64
}

type Ele

type Ele struct {
	js.Value
}

func Article

func Article() *Ele

func Aside

func Aside() *Ele

func Button

func Button() *Ele

func Code

func Code() *Ele

func CreateElement

func CreateElement(tag string) *Ele

func CreateTextNode

func CreateTextNode(str string) *Ele

func Dd

func Dd() *Ele

func Div

func Div(text ...[]any) *Ele

func Dt

func Dt() *Ele
func Footer() *Ele

func For

func For[T any](getList func() []T, render func(T, int) *Ele) *Ele

func Form

func Form() *Ele

func GetElementById

func GetElementById(id string) *Ele

func H1

func H1() *Ele

func H2

func H2() *Ele

func H3

func H3() *Ele

func H4

func H4() *Ele

func H5

func H5() *Ele

func H6

func H6() *Ele

func HPoint

func HPoint() *Ele
func Header() *Ele

func I

func I() *Ele

func If

func If(check func() bool, render func() *Ele) *Ele

func IfElse

func IfElse(check func() bool, ifRender func() *Ele, elseRender func() *Ele) *Ele

func Iframe

func Iframe() *Ele

func Input

func Input() *Ele

func Kbd

func Kbd() *Ele

func Label

func Label() *Ele

func Li

func Li() *Ele
func Link() *Ele

func Mark

func Mark() *Ele
func Menu() *Ele

func Meta

func Meta() *Ele
func Nav() *Ele

func Ol

func Ol() *Ele

func P

func P() *Ele

func Script

func Script() *Ele

func Section

func Section() *Ele

func Select

func Select() *Ele

func Span

func Span() *Ele

func Strong

func Strong() *Ele

func Style

func Style() *Ele

func Svg

func Svg() *Ele

func Table

func Table() *Ele

func Td

func Td() *Ele

func Template

func Template() *Ele

func Textarea

func Textarea() *Ele

func Th

func Th() *Ele

func Tr

func Tr() *Ele

func Ul

func Ul() *Ele

func (*Ele) Append

func (target *Ele) Append(children ...any) *Ele

func (*Ele) Attr

func (target *Ele) Attr(name string, val any) *Ele

func (*Ele) Blur

func (target *Ele) Blur() *Ele

func (*Ele) ChildElementCount

func (target *Ele) ChildElementCount() int

func (*Ele) Class

func (target *Ele) Class(val any) *Ele

func (*Ele) ClassListAdd

func (target *Ele) ClassListAdd(css string) *Ele

func (*Ele) ClassListContains

func (target *Ele) ClassListContains(css string) bool

func (*Ele) ClassListRemove

func (target *Ele) ClassListRemove(key string) *Ele

func (*Ele) ClassListRemoveText

func (target *Ele) ClassListRemoveText(key string) *Ele

func (*Ele) ClassListReplace

func (target *Ele) ClassListReplace(key, css string) *Ele

func (*Ele) Closest

func (target *Ele) Closest(selector string) *Ele

func (*Ele) Contains

func (target *Ele) Contains(ele *Ele) bool

func (*Ele) CssText

func (target *Ele) CssText(val string) *Ele

func (*Ele) Dispatch

func (target *Ele) Dispatch(event string)

func (*Ele) DispatchInput

func (target *Ele) DispatchInput(event string)

func (*Ele) FirstElementChild

func (target *Ele) FirstElementChild() *Ele

func (*Ele) Focus

func (target *Ele) Focus() *Ele

func (*Ele) GetAttr

func (target *Ele) GetAttr(name string) string

func (*Ele) GetBoundingClientRect

func (target *Ele) GetBoundingClientRect() BoundingClientRect

func (*Ele) GetChild

func (target *Ele) GetChild(num int) *Ele

func (*Ele) GetClass

func (target *Ele) GetClass() string

func (*Ele) GetComputedStyle

func (target *Ele) GetComputedStyle() js.Value

func (*Ele) GetElementById

func (target *Ele) GetElementById(q string) *Ele

func (*Ele) GetHeight

func (target *Ele) GetHeight() float64

func (*Ele) GetId

func (target *Ele) GetId() string

func (*Ele) GetInnerHTML

func (target *Ele) GetInnerHTML() string

func (*Ele) GetInnerText

func (target *Ele) GetInnerText() string

func (*Ele) GetName

func (target *Ele) GetName() string

func (*Ele) GetOffsetLeft

func (target *Ele) GetOffsetLeft() float64

func (*Ele) GetOffsetTop

func (target *Ele) GetOffsetTop() float64

func (*Ele) GetPlaceholder

func (target *Ele) GetPlaceholder() string

func (*Ele) GetSrc

func (target *Ele) GetSrc() string

func (*Ele) GetStyle

func (target *Ele) GetStyle(k string) string

func (*Ele) GetTagName

func (target *Ele) GetTagName() string

func (*Ele) GetText

func (target *Ele) GetText() string

func (*Ele) GetType

func (target *Ele) GetType() string

func (*Ele) GetValue

func (target *Ele) GetValue() string

func (*Ele) GetValueBool

func (target *Ele) GetValueBool() bool

func (*Ele) GetWidth

func (target *Ele) GetWidth() float64

func (*Ele) HasAttr

func (target *Ele) HasAttr(name string) bool

func (*Ele) Id

func (target *Ele) Id(val any) *Ele

func (*Ele) InnerHTML

func (target *Ele) InnerHTML(val any) *Ele

func (*Ele) InnerText

func (target *Ele) InnerText(val any) *Ele

func (*Ele) InputMode

func (target *Ele) InputMode(val any) *Ele

func (*Ele) InsertAdjacentElement

func (target *Ele) InsertAdjacentElement(position string, ele *Ele) *Ele

func (*Ele) LastElementChild

func (target *Ele) LastElementChild() *Ele

func (*Ele) Listen

func (target *Ele) Listen(key string, fn func(event js.Value)) *Ele

func (*Ele) ListenCallback

func (target *Ele) ListenCallback(key string, fn func(event js.Value)) func()

func (*Ele) Max

func (target *Ele) Max(val any) *Ele

func (*Ele) MaxLength

func (target *Ele) MaxLength(val any) *Ele

func (*Ele) Min

func (target *Ele) Min(val any) *Ele

func (*Ele) MinLength

func (target *Ele) MinLength(val any) *Ele

func (*Ele) Name

func (target *Ele) Name(val any) *Ele

func (*Ele) NextElementSibling

func (target *Ele) NextElementSibling() *Ele

func (*Ele) On

func (target *Ele) On(key string, fn func(event js.Value)) *Ele

func (*Ele) OnChange

func (target *Ele) OnChange(fn func(e *Ele)) *Ele

func (*Ele) OnClick

func (target *Ele) OnClick(fn func()) *Ele

OnClick 为了移动端更快的点击响应,OnClick 事件区分了移动端和桌面端的实现,若在开发环境从移动端切换到桌面端,会遇到点击无响应的Bug,由于这种情况仅限于开发者,所以为了更少的事件判断,不做相关兼容

func (*Ele) OnInput

func (target *Ele) OnInput(fn func(e *Ele)) *Ele

func (*Ele) OnMount

func (target *Ele) OnMount(fn func()) *Ele

func (*Ele) OnMouseCancel

func (target *Ele) OnMouseCancel(fn func(e *Ele)) *Ele

func (*Ele) OnMouseDown

func (target *Ele) OnMouseDown(fn func(e *Ele)) *Ele

func (*Ele) OnMouseEnter

func (target *Ele) OnMouseEnter(fn func(e *Ele)) *Ele

func (*Ele) OnMouseMove

func (target *Ele) OnMouseMove(fn func(e *Ele)) *Ele

func (*Ele) OnMouseUp

func (target *Ele) OnMouseUp(fn func(e *Ele)) *Ele

func (*Ele) OnRemove

func (target *Ele) OnRemove(fn func()) *Ele

func (*Ele) OnSubmit

func (target *Ele) OnSubmit(fn func(ele *Ele)) *Ele

func (*Ele) OnTouchCancel

func (target *Ele) OnTouchCancel(fn func(e *Ele)) *Ele

func (*Ele) OnTouchDown

func (target *Ele) OnTouchDown(fn func(e *Ele)) *Ele

func (*Ele) OnTouchMove

func (target *Ele) OnTouchMove(fn func(e *Ele)) *Ele

func (*Ele) OnTouchUp

func (target *Ele) OnTouchUp(fn func(e *Ele)) *Ele

func (*Ele) ParentElement

func (target *Ele) ParentElement() *Ele

func (*Ele) Placeholder

func (target *Ele) Placeholder(val any) *Ele

func (*Ele) QuerySelector

func (target *Ele) QuerySelector(q string) *Ele

func (*Ele) QuerySelectorAll

func (target *Ele) QuerySelectorAll(q string) []*Ele

func (*Ele) QuerySelectorAllRemove

func (target *Ele) QuerySelectorAllRemove(q string)

func (*Ele) Ref

func (target *Ele) Ref(fn func(*Ele)) *Ele

func (*Ele) Remove

func (target *Ele) Remove()

func (*Ele) RemoveAttr

func (target *Ele) RemoveAttr(val string) *Ele

func (*Ele) RemoveChild

func (target *Ele) RemoveChild(val *Ele) *Ele

func (*Ele) ReplaceChild

func (target *Ele) ReplaceChild(next *Ele, old *Ele) *Ele

func (*Ele) ReplaceWith

func (target *Ele) ReplaceWith(next *Ele) *Ele

func (*Ele) SetKV

func (target *Ele) SetKV(k string, v any) *Ele

func (*Ele) SetValueAndDispatch

func (target *Ele) SetValueAndDispatch(val, eventName any) *Ele

func (*Ele) Src

func (target *Ele) Src(val any) *Ele

func (*Ele) Style

func (target *Ele) Style(k string, val any) *Ele

func (*Ele) StyleMap

func (target *Ele) StyleMap(val any) *Ele

func (*Ele) Text

func (target *Ele) Text(val any) *Ele

func (*Ele) Type

func (target *Ele) Type(val any) *Ele

func (*Ele) Val

func (target *Ele) Val(val any) *Ele

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL