Search code examples
internet-explorercomvuetify.jscompatibilitycdn

How to make Vuetify compatible with IE in CDN


i want make Vuetify compatible with IE in my CDN website. This is my code(with PHP):

    <v-app>
    <div>
   <v-btn>Dont work in IE</v-btn>
    </div>
    </v-app>
  </div>
  <script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=fetch&flags=gated"></script>
  <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vuetify.js"></script>
  
  <script>
    new Vue({
  el: '#app',
  vuetify: new Vuetify(),
  data () {
    return {
      dialog: false,
    }
  },
})
  </script>
But, polyfill dont word, c## Heading ##an you help please ?


Solution

  • I check the official doc and it says we need to use babel-polyfill to support Vuetify in IE 11. The CDN url of babel-polyfill is https://cdnjs.cloudflare.com/ajax/libs/babel-polyfill/7.10.4/polyfill.js. We can include it in the first one <script> tags. Then it can work well in IE 11.

    The sample code is like below:

    <!DOCTYPE html>
    <html>
    <head>
        <link href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900" rel="stylesheet">
        <link href="https://cdn.jsdelivr.net/npm/@mdi/[email protected]/css/materialdesignicons.min.css" rel="stylesheet">
        <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/vuetify.min.css" rel="stylesheet">
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, minimal-ui">
    </head>
    <body>
        <div id="app">
            <v-app>
                <v-main>
                    <v-container>Hello world</v-container>
                </v-main>
            </v-app>
        </div>
    
        <script src="https://cdnjs.cloudflare.com/ajax/libs/babel-polyfill/7.10.4/polyfill.js"></script>
        <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.js"></script>
        <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vuetify.js"></script>
        <script>
        new Vue({
          el: '#app',
          vuetify: new Vuetify(),
        })
        </script>
    </body>
    </html>
    

    Reference link: https://cdnjs.com/libraries/babel-polyfill