Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

script property is not working in head() #272

Open
serdaronedio opened this issue Dec 2, 2021 · 1 comment
Open

script property is not working in head() #272

serdaronedio opened this issue Dec 2, 2021 · 1 comment

Comments

@serdaronedio
Copy link

serdaronedio commented Dec 2, 2021

Hi there;

When i use amp mode in a page, script property isn't working in head() methods. I need to add custom script to the page. How can i fix it?

Thanks a lot.

<template>
  <div>The test</div>
</template>

<script>
export default {
  amp: 'only', // if i remove this line, script prop is working in head(),
  ampLayout: 'default.amp',
  head() {
    return {
      title: 'Test title', // working
      "script": [
        {
          innerHTML: `window.test = 'abcd1234'`,
          type: 'text/javascript',
          charset: 'utf-8',
        },
      ], // script props is not working on ssr,
    }
  }
}
</script>
@serdaronedio serdaronedio changed the title script key not working in head() script property is not working in head() Dec 2, 2021
@NaraTouch
Copy link

I also facing this issue as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants