good icon indicating copy to clipboard operation
good copied to clipboard

Add Goox Component System

Open aleksei0807 opened this issue 8 years ago • 1 comments

package someComponent

type Comp struct {
    GooxComponent
}

func (c *Comp) Render() GooxComponent {
    return (
        <div class="some-component">
            {c.Childs}
        </div>
    )
}
package template

import "someComponent"

func Render() GooxComponent {
    var s = <span>span from var</span>
    return (
    <someComponent.Comp>
        <div class="abc" style={ GooxStyle{ Padding: 10 } }>
            <p>Goox demo</p>
            {s}
        </div>
    </someComponent.Comp>
    )
}
package main

import (
    "template"
    "fmt"
)

func main() {
    fmt.Println(template.Render())
}

should print in console:

<div class="some-component">
    <div class="abc" style="padding: 10px">
        <p>Goox demo</p>
        <span>span from var</span>
    </div>
</div>

also should be printable as a struct with fmt.Printf("%#+v", gooxcomp) and be compatible to work with struct syntax like gooxcomp.Style.Padding

aleksei0807 avatar Dec 06 '16 19:12 aleksei0807

@aleksei0807 +1

kirillDanshin avatar Dec 06 '16 20:12 kirillDanshin