代码之家  ›  专栏  ›  技术社区  ›  CCCC

脉轮用户界面-样式不适用

  •  1
  • CCCC  · 技术社区  · 4 年前

    我期待的是: enter image description here

    事实表明: enter image description here

    应用程序。js

    import "./styles.css";
    import { HStack, PinInput, PinInputField } from "@chakra-ui/react";
    
    export default function App() {
      return (
        <div className="App">
          <HStack>
            <PinInput type="alphanumeric">
              <PinInputField />
              <PinInputField />
              <PinInputField />
              <PinInputField />
            </PinInput>
          </HStack>
        </div>
      );
    }
    

    代码沙盒:
    https://codesandbox.io/s/romantic-snowflake-km87e?file=/src/App.js

    0 回复  |  直到 4 年前
        1
  •  0
  •   DCCW    4 年前

    您似乎忘记了提供商的设置。请确保阅读中的设置 the documentation .

    应用程序组件周围应该有以下代码,帮助您解决问题。

    import { ChakraProvider } from '@chakra-ui/react'
    
    <ChakraProvider>
      <App />
    </ChakraProvider>
    
    推荐文章