悬停在侧边栏上时,文字显示为弯曲

发布于 2025-01-30 00:46:22 字数 2186 浏览 2 评论 0原文

我正在使用脉轮UI。
悬停在侧边栏上的侧边栏向右扩展。
文字在向右的路上弯曲。
有什么办法可以在不弯曲字母的情况下扩大侧边栏?
如果有人可以帮助我理解,我将感谢您的帮助。

 <Flex
      background="blue.50"
      flexDirection="column"
      height="100vh"
      justifyContent="space-between"
      onMouseEnter={() => setState((prevState) => !prevState)}
      onMouseLeave={() => setState((prevState) => !prevState)}
      position="fixed"
      width={state ? "204px" : "44px"}
      zIndex={10}
      transition={"all .2s ease"}
    >
      <Box transition="all 0.3s">
        <HStack p={3}>
          <Flex alignItems="center">
            <Image
              display={state ? "none" : "inline-block"}
              height="24px"
              src={""}
              transition="all 0.3s ease-in-out"
            />
            <Image
              display={state ? "inline-block" : "none"}
              src={"chakra_logo.png"}
            />
          </Flex>
          <Text display={state ? "inline-block" : "none"} fontSize="xs">
            logo
          </Text>
        </HStack>
        <VStack mt={3} spacing={0}>
          <Box _hover={{ backgroundColor: "gray.200" }} width="full">
            <Link>
              <a>
                <HStack p={3}>
                  <BiSearchAlt />
                  <Text display={state ? "inline-block" : "none"}>
                    search Page
                  </Text>
                </HStack>
              </a>
            </Link>
          </Box>
        </VStack>
      </Box>
      <VStack mb={2} spacing={0}>
        <Box mb={2} px={3} width="full">
          <Divider borderColor="gray.300" />
        </Box>
        <Box _hover={{ backgroundColor: "gray.200" }} p={3} width="full">
          <HStack>
            <Image src={""} width="24px" />
            <Text display={state ? "inline-block" : "none"}>
              My Page Setting
            </Text>
          </HStack>
        </Box>
      </VStack>
    </Flex>

I'm using chakra ui.
Hovering over the Sidebar expands the sidebar to the right.
The text is bent on the way to the right.
Is there any way to widen the Sidebar without bending the letters?
If anyone can help me understand, I would appreciate your help.
code

 <Flex
      background="blue.50"
      flexDirection="column"
      height="100vh"
      justifyContent="space-between"
      onMouseEnter={() => setState((prevState) => !prevState)}
      onMouseLeave={() => setState((prevState) => !prevState)}
      position="fixed"
      width={state ? "204px" : "44px"}
      zIndex={10}
      transition={"all .2s ease"}
    >
      <Box transition="all 0.3s">
        <HStack p={3}>
          <Flex alignItems="center">
            <Image
              display={state ? "none" : "inline-block"}
              height="24px"
              src={""}
              transition="all 0.3s ease-in-out"
            />
            <Image
              display={state ? "inline-block" : "none"}
              src={"chakra_logo.png"}
            />
          </Flex>
          <Text display={state ? "inline-block" : "none"} fontSize="xs">
            logo
          </Text>
        </HStack>
        <VStack mt={3} spacing={0}>
          <Box _hover={{ backgroundColor: "gray.200" }} width="full">
            <Link>
              <a>
                <HStack p={3}>
                  <BiSearchAlt />
                  <Text display={state ? "inline-block" : "none"}>
                    search Page
                  </Text>
                </HStack>
              </a>
            </Link>
          </Box>
        </VStack>
      </Box>
      <VStack mb={2} spacing={0}>
        <Box mb={2} px={3} width="full">
          <Divider borderColor="gray.300" />
        </Box>
        <Box _hover={{ backgroundColor: "gray.200" }} p={3} width="full">
          <HStack>
            <Image src={""} width="24px" />
            <Text display={state ? "inline-block" : "none"}>
              My Page Setting
            </Text>
          </HStack>
        </Box>
      </VStack>
    </Flex>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

尹雨沫 2025-02-06 00:46:22

为了防止文本包装,您可以添加whitespace =“ nowrap” and Overflow =“ hidden” props props props props props props props props &lt; text/&gt; 元素。

To prevent text from wrapping, you can add whiteSpace="nowrap" and overflow="hidden" props to the <Text /> elements.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文