使用样式组件隐藏输入微调器

时间:2019-05-29 02:28:05

标签: css styled-components

有很多解决方案可以使用CSS隐藏输入微调器。其中之一是:

// hello.py
class Test(object):
    def __init__(self, name):
        print(name)
    def hello(self, line):
        return line

// test.go
import (
    "github.com/sbinet/go-python"
    "log"
)

func init() {
    err := python.Initialize()
    if err != nil {
        panic(err.Error())
    }
}

func main() {
    hello := python.PyImport_ImportModule("hello")
    if hello == nil {
        log.Fatalf("could not import 'hello'\n")
    }

    testGetter := hello.GetAttrString("Test")
    if testGetter == nil {
        log.Fatalf("could not retrieve 'hello.Test'")
    }

    gostr := "here is a test"
    pystr := python.PyString_FromString(gostr)
    test := python.PyInstance_New(testGetter, pystr, nil)
    if test == nil {
                 // log fail at here
        log.Fatalf("could not retrieve 'test'")
    }
}

我想知道如何在样式化组件中实现它?谢谢

1 个答案:

答案 0 :(得分:1)

这样声明:

const Input = styled.input`
    ::-webkit-inner-spin-button{
        -webkit-appearance: none; 
        margin: 0; 
    }
    ::-webkit-outer-spin-button{
        -webkit-appearance: none; 
        margin: 0; 
    }    
`;

像这样使用:

<Input type="number">

相关问题