2

how to include a tag on a Vue component

it's not just normal script but it inside

 <form class="checkout-form" name="checkoutForm" method="POST" action="/checkout">
      <script type="text/javascript" src="https://cdn.omise.co/omise.js"
              data-key="YOUR_PUCLIC_KEY"
              data-frame-label="Merchant site name"
              data-frame-description="Merchant site description"
              data-default-payment-method="bill_payment_tesco_lotus"
              data-other-payment-methods="internet_banking, bill_payment_tesco_lotus, alipay, credit_card"
              data-amount="10025"
              data-currency="usd"
              data-button-label="Click to see an example">
      </script>
    </form>
1
  • Looking at omise.co/omise-js-api, there are alternative ways to use the Omise API without requiring the script inside the form. Commented May 7, 2018 at 14:06

1 Answer 1

2

In my option, this code is better way, use vuemeta

export default {
  data() {
    return {
      scriptOmine: {
        src: 'https://cdn.omise.co/omise.js'
        'data-key': 'YOUR_PUCLIC_KEY',
        'data-frame-label': 'Merchant site name',
        ...
      }
    }
  },
  metaInfo: {
    title: 'My Example App',
    bodyScript: [
      { src: 'js/example.js' },
      { this.scriptOmine }
    ]
  }
}

Is more simpler and readable

More doc: https://github.com/declandewet/vue-meta#script-object

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.