Vue + Vuetify在Chrome 36老版本中CSS渲染异常的解决咨询
Hey there! As someone who’s dealt with old browser compatibility headaches before, I totally get how frustrating this can be. Chrome 36 is a super outdated release (from 2014) that lacks full support for modern CSS features like Flexbox (which Vuetify relies on heavily for its Grid system) and has zero support for CSS Grid. Let’s break down actionable solutions to fix your rendering issues:
1. Downgrade to Vuetify 1.x
Vuetify 2.x and above are built for modern browsers, but Vuetify 1.x was designed with better legacy browser support. Its grid system uses more compatible Flexbox syntax (or even fallbacks like float-based layouts in some cases). Here’s how to make the switch:
- Uninstall your current Vuetify version:
npm uninstall vuetify - Install the latest stable 1.x release:
npm install vuetify@1.5.24 - Update your app’s Vuetify initialization code (1.x uses
Vue.use(Vuetify)instead of the newercreateVuetifyAPI) and adjust your grid components: replace 2.x/3.x’sv-rowandv-colwith 1.x’sv-layoutandv-flexcomponents.
2. Add CSS Prefixes & Fallback Styles
Chrome 36 supports prefixed Flexbox properties, but many unprefixed modern properties will fail. Use PostCSS with Autoprefixer to automatically add the necessary vendor prefixes:
- Create or update your
postcss.config.jsfile:module.exports = { plugins: [ require('autoprefixer')({ overrideBrowserslist: ['Chrome >= 36'] }) ] } - For critical Vuetify Grid styles, you can also manually add fallback properties in a global CSS file. For example:
This ensures Chrome 36 recognizes the Flexbox properties it supports..v-row { display: -webkit-box; display: -webkit-flex; display: flex; -webkit-flex-wrap: wrap; flex-wrap: wrap; } .v-col { -webkit-box-flex: 0; -webkit-flex: 0 0 auto; flex: 0 0 auto; box-sizing: border-box; }
3. Replace Vuetify Grid with Custom Legacy-Friendly Layouts
If you don’t want to downgrade Vuetify, build your own grid components using older, more compatible CSS techniques like floats or inline-block:
- Example of a simple custom row/col component:
Use these components instead of Vuetify’s built-in grid to avoid compatibility gaps.<template> <div class="legacy-row"> <slot></slot> </div> </template> <style scoped> .legacy-row { overflow: hidden; /* Clear float */ margin: 0 -8px; } .legacy-col { float: left; padding: 0 8px; box-sizing: border-box; } .legacy-col-6 { width: 50%; } .legacy-col-12 { width: 100%; } </style>
4. Tweak Vuetify’s CSS Build Settings
If you’re using Vuetify 2.x+, you can try disabling features that rely on unsupported CSS:
- Enable tree-shaking to only include styles for the components you actually use, reducing the chance of pulling in uncompatible CSS.
- Force Vuetify to use Flexbox instead of CSS Grid (if enabled) by adjusting your Vuetify config, since Chrome 36 has partial Flexbox support but no CSS Grid support.
A quick heads-up: Chrome 36 is so old that you might run into other issues down the line (even with polyfills for JS). If at all possible, encourage your users to upgrade to a modern browser—this will save you a ton of long-term hassle.
内容的提问来源于stack exchange,提问作者Pablo Souza

