vue-meta icon indicating copy to clipboard operation
vue-meta copied to clipboard

Request for inline comments

Open davutkara opened this issue 6 years ago • 12 comments

Sometimes need to add the code below for ie browser.

<!--[if IE]>
<![endif]>

It can be added like this.

{
  metaInfo: {
    meta: [
      { charset: 'utf-8' },
      { name: 'viewport', content: 'width=device-width, initial-scale=1' },
      '<!--[if IE]>',
      { name: 'script', src:'index.js'}
      '<![endif]>'
    ]
  }
}

I tried to make on my branch to make pull-request but, I got some dependency errors.

davutkara avatar Aug 06 '18 07:08 davutkara

Total sidebar: Does your app really need support IE10? These tags are not supported in IE11/Edge.

hecktarzuli avatar Dec 03 '18 20:12 hecktarzuli

@hecktarzuli This feature can be needed for other purpose. I think if the item of meta array is string, add string directly. Also there are a few people who uses old IE browsers.

davutkara avatar Dec 04 '18 07:12 davutkara

This might cause a problem when using multiple child components which set the same vmid and only one has the comments defined. Not sure if we can guarantee the correct order in that case when everything is merged

@manniL Wdyt? We could also add prefix / suffix attributes (which maybe only work on ssr?)

pimlie avatar Mar 08 '19 11:03 pimlie

I'm not sure if it's worth the hassle implementing it as it only helps With IE < 11. People using Nuxt can always use a custom AppView (HTML file) anyway.

TheAlexLichter avatar Mar 08 '19 14:03 TheAlexLichter

I have added the target: v3 label because if we are going to refactor vue-meta as proposed then it should probably be supported by default already (using vue 3.0 fragments)

pimlie avatar Mar 08 '19 14:03 pimlie

I'm trying to include a fragment such as below (from stackoverflow). Is there another way to do this with vue-meta, or should I look for another solution, while waiting on this branch? (My intention is to not support IE -- and explicitly navigate users somewhere else to tell them it isn't supported.)

<!-- For IE <= 9 -->
<!--[if IE]>
<script type="text/javascript">
    window.location = "https://google.com";
</script>
<![endif]-->

<!-- For IE > 9 -->
<script type="text/javascript">
    if (window.navigator.msPointerEnabled) {
        window.location = "https://google.com";
    }
</script>

shaunc avatar May 27 '20 00:05 shaunc

I'm trying to include a fragment such as below (from stackoverflow). Is there another way to do this with vue-meta, or should I look for another solution, while waiting on this branch? (My intention is to not support IE -- and explicitly navigate users somewhere else to tell them it isn't supported.)

<!-- For IE <= 9 -->
<!--[if IE]>
<script type="text/javascript">
    window.location = "https://google.com";
</script>
<![endif]-->

<!-- For IE > 9 -->
<script type="text/javascript">
    if (window.navigator.msPointerEnabled) {
        window.location = "https://google.com";
    }
</script>

You can detect IE in other ways with pure JS btw.

export default {
  data () {
    return {
      isInternetExplorer: false
    }
  },
  beforeMount () {
    this.isInternetExplorer = Boolean(document.documentMode)
  }
}

TheAlexLichter avatar May 27 '20 07:05 TheAlexLichter

The problem is that my vue code doesn't run on IE. Perhaps if I were to dumb down the javascript dialect and/or fiddle with babel it would work, but I'd prefer just to redirect. Should be simple(?)

shaunc avatar May 27 '20 13:05 shaunc

@shaunc Are you using Nuxt.js? Then you could include this static piece of code in your app template

If you are not using Nuxt then you will probably still have a similar app template file that you use with ssr, so you should be able to apply the same fix. Look up the docs of the framework you are using.

pimlie avatar Jun 06 '20 08:06 pimlie

Ah -- cool; I am using Nuxt. I overlooked the "app template" setting. Thank you!

shaunc avatar Jun 06 '20 14:06 shaunc

People using Nuxt can always use a custom AppView (HTML file) anyway.

@manniL Do you mean we can use a custom HTML file as the template (like the public/index.html in vue-cli)? If yes, how?

1isten avatar Aug 22 '20 15:08 1isten

@manniL Oh I just found the doc: https://nuxtjs.org/guide/views/#app-template

1isten avatar Aug 22 '20 15:08 1isten