流星条纹元素无法渲染

问题描述 投票:0回答:1

我试图使用带有流星形式的条纹元素形式(v3)。所有代码运行时都没有爆炸,但在调用mount()后没有任何内容呈现。有任何想法吗?

JS:

Template.billing.onRendered(function(){
  let elements = stripe.elements();
  let style = {
    base: {
      // Add your base input styles here. For example:
      fontSize: '16px',
      color: "#32325d",
    }
  };
  let card = elements.create('card', {style: style});
  card.mount('#card-element');
  console.log("done");
})

HTML:

<template name="billing">
   <form id="payment-form">
    <div class="form-row">
      <label for="card-element">
        Credit or debit card
      </label>
      <div id="card-element">
      </div>
      <div id="card-errors" role="alert"></div>
    </div>
    <input type="submit" class="submit" value="Submit Payment">
  </form>
</template>
meteor stripe-payments meteor-blaze stripe.js
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.