Skip to content

script property is not working in head() #272

@serdaronedio

Description

@serdaronedio

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>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions