Tailwind Flex - 全尺寸宽度

Tailwind Flex - Width full size

index.html:

<!DOCTYPE html>
<html lang="">
  <head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width,initial-scale=1.0" />
    <link rel="icon" href="<%= BASE_URL %>favicon.ico" />
    <title><%= htmlWebpackPlugin.options.title %></title>
  </head>
  <body>
    <noscript>
      <strong
        >We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work
        properly without JavaScript enabled. Please enable it to
        continue.</strong
      >
    </noscript>
    <div id="app" class="bg-red-300"></div>
    <!-- built files will be auto injected -->
  </body>
</html>

App.vue:

<template>
  <div class="flex flex-col md:flex-row">
    <Nav class="bg-gray-300 md:w-1/4" />
    <router-view class="bg-yellow-400" />
  </div>
</template>

<script>
import Nav from './components/nav_components/Nav.vue';
export default {
  name: 'App',
  components: {
    Nav,
  },
};
</script>

<style></style>

直到 768px 我使用 flex-col,对于更大的屏幕尺寸我使用 flex-row 正如你在我的代码中看到的那样。


结果:(0-768px 宽度,flex-col):

在 640px 和 768px 之间,我的 Nav 和 router-view 容器的宽度停止扩展,我可以看到我安装应用程序的位置的红色背景。


结果:(>768px 宽度,弹性行):

在 2050px 之后,我的容器停止扩展,导致与前面提到的相同的结果。


我该怎么做才能解决此问题?

最大宽度默认为 1536 像素。将 max-w-full 设置为我的路由器视图容器解决了这个问题。