【问题标题】:@google-pay/button-angular issue: Cannot read properties of undefined (reading 'pay'),@google-pay/button-angular 问题:无法读取未定义的属性(读取 \'pay\'),
【发布时间】:2022-08-23 19:25:11
【问题描述】:

对于我的应用程序中的 Google 支付付款,我在 Angular 中使用了 @google-pay/button-angular

HTML 代码是: <google-pay - button[environment]=\"current_env\"[buttonColor] = \"buttonColor\"[buttonType] = \"buttonType\"

[buttonSizeMode] = \"isCustomSize ? \'fill\' : \'static\'\"[paymentRequest] = \"paymentRequest\"

(loadpaymentdata) = \"onLoadPaymentData($event)\" >

在 TS 文件中,代码是,

current_env: String = environment.production != true ? \"测试\" : \"生产\";

按钮颜色:字符串=“黑色”;

buttonType: String = \"支付\";

isCustomSize = false;

早些时候它工作正常。

今天我观察到该元素显示了 Google Pay 按钮。附上错误。

    标签: angular angular6 integration element google-pay


    【解决方案1】:

    在修复时,我发现 'pay' 在 'buttonType' 选项中不起作用。所以,我把它改成

    按钮类型:字符串 = “短”;

    现在可以正常使用了,详情请参考https://www.npmjs.com/package/@google-pay/button-angular

    【讨论】:

      猜你喜欢
      • 2022-01-01
      • 1970-01-01
      • 2022-01-22
      • 2017-11-09
      • 1970-01-01
      • 1970-01-01
      • 2021-10-31
      相关资源
      最近更新 更多