2023-05-25 13:59:13 +00:00
|
|
|
package main
|
|
|
|
|
2023-06-23 19:10:35 +00:00
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
|
|
|
|
"github.com/vugu/vugu"
|
|
|
|
)
|
2023-05-27 11:37:40 +00:00
|
|
|
|
2023-05-25 13:59:13 +00:00
|
|
|
type PageInput struct {
|
2023-05-25 14:37:46 +00:00
|
|
|
button1Counter int `vugu:"data"`
|
|
|
|
button4Bool bool `vugu:"data"`
|
2023-05-25 13:59:13 +00:00
|
|
|
|
2023-06-23 18:41:04 +00:00
|
|
|
radioButton1 string `vugu:"data"`
|
|
|
|
|
|
|
|
checkBox1 bool `vugu:"data"`
|
|
|
|
checkBox2 bool `vugu:"data"`
|
|
|
|
|
2023-06-23 19:10:35 +00:00
|
|
|
inputField1String string `vugu:"data"`
|
|
|
|
inputField2Int int `vugu:"data"`
|
|
|
|
inputField3Float float64 `vugu:"data"`
|
|
|
|
inputField4String string `vugu:"data"`
|
|
|
|
inputField5String string `vugu:"data"`
|
|
|
|
inputField5Bool bool `vugu:"data"`
|
|
|
|
inputField6Bool bool `vugu:"data"`
|
|
|
|
inputField7Time time.Time `vugu:"data"`
|
2023-05-27 11:37:40 +00:00
|
|
|
|
|
|
|
dropdown1Slice []string `vugu:"data"`
|
|
|
|
dropdown1Index int `vugu:"data"`
|
2023-06-02 09:17:22 +00:00
|
|
|
|
|
|
|
tags1Slice []string `vugu:"data"`
|
2023-06-26 22:23:07 +00:00
|
|
|
|
|
|
|
textArea1 string `vugu:"data"`
|
2023-05-27 11:37:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (c *PageInput) Init(ctx vugu.InitCtx) {
|
2023-06-23 18:41:04 +00:00
|
|
|
c.radioButton1 = "B"
|
|
|
|
c.checkBox2 = true
|
2023-06-23 19:10:35 +00:00
|
|
|
c.inputField7Time = time.Now()
|
2023-05-27 11:37:40 +00:00
|
|
|
c.dropdown1Slice = []string{"This", "is", "a", "list", "of", "things!"}
|
2023-06-02 09:17:22 +00:00
|
|
|
c.tags1Slice = []string{"some", "tags"}
|
2023-06-26 22:23:07 +00:00
|
|
|
c.textArea1 = "This is some example text\n\nAnd some line-breaks."
|
2023-05-25 13:59:13 +00:00
|
|
|
}
|