簡體   English   中英

聚合物google-signin元素獲取無法讀取null的屬性“ currentUser”

[英]Polymer google-signin element gets Cannot read property 'currentUser' of null

我正在嘗試使google-signin元素起作用,只需將其添加到我的HTML中即可:

<google-signin clientId="[my-client-id]" scopes="https://www.googleapis.com/auth/drive"></google-signin>

頁面上顯示“登錄”按鈕,但是當我單擊它時,出現錯誤:

Cannot read property 'currentUser' of null

我僅在localhost上進行測試,因此不確定是否是客戶端ID域問題,或者是否需要在JS中做更多操作來處理返回對象?

有什么想法嗎? 非常感謝!

嘗試使用client-id而不是clientId

<google-signin client-id="[my-client-id]" scopes="https://www.googleapis.com/auth/drive"></google-signin>

此屬性的google-signin文檔與實際代碼不匹配。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM