-
Notifications
You must be signed in to change notification settings - Fork 0
/
my-line.go
53 lines (45 loc) · 1.87 KB
/
my-line.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package main
// DO NOT EDIT: This file was generated by vugu. Please regenerate instead of editing or add additional code in a separate file.
import "fmt"
import "reflect"
import "github.com/vugu/vugu"
type MyLineData struct {
FileName string
LineNumber int
}
func (*MyLine) NewData(props vugu.Props) (interface{}, error) {
return &MyLineData{
FileName: props["file-name"].(string),
LineNumber: props["line-number"].(int),
}, nil
}
var _ vugu.ComponentType = (*MyLine)(nil)
func (comp *MyLine) BuildVDOM(dataI interface{}) (vdom *vugu.VGNode, css *vugu.VGNode, reterr error) {
data := dataI.(*MyLineData)
_ = data
_ = fmt.Sprint
_ = reflect.Value{}
event := vugu.DOMEventStub
_ = event
var n *vugu.VGNode
n = &vugu.VGNode{Type: vugu.VGNodeType(3), Data: "li", DataAtom: vugu.VGAtom(45570), Namespace: "", Attr: []vugu.VGAttribute{vugu.VGAttribute{Namespace: "", Key: "class", Val: "my-line"}}}
vdom = n
{
parent := n
n = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n ", DataAtom: vugu.VGAtom(0), Namespace: "", Attr: []vugu.VGAttribute(nil)}
parent.AppendChild(n)
n = &vugu.VGNode{Type: vugu.VGNodeType(3), Data: "strong", DataAtom: vugu.VGAtom(449798), Namespace: "", Attr: []vugu.VGAttribute(nil)}
parent.AppendChild(n)
n.InnerHTML = fmt.Sprint(data.FileName)
n = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: ":", DataAtom: vugu.VGAtom(0), Namespace: "", Attr: []vugu.VGAttribute(nil)}
parent.AppendChild(n)
n = &vugu.VGNode{Type: vugu.VGNodeType(3), Data: "span", DataAtom: vugu.VGAtom(40708), Namespace: "", Attr: []vugu.VGAttribute(nil)}
parent.AppendChild(n)
n.InnerHTML = fmt.Sprint(data.LineNumber)
n = &vugu.VGNode{Type: vugu.VGNodeType(1), Data: "\n", DataAtom: vugu.VGAtom(0), Namespace: "", Attr: []vugu.VGAttribute(nil)}
parent.AppendChild(n)
}
return
}
type MyLine struct {}
func init() { vugu.RegisterComponentType("my-line", &MyLine{}) }