0
我正在研究Shopify Embedded App SDK和theres的一部分,你必須從服務器端變量中刪除一些JavaScript。我正在使用react engine,react-router和express.js。添加一些服務器端的動態客戶端JavaScript到一個反應的應用程序
<head>
<script src="https://cdn.shopify.com/s/assets/external/app.js"></script>
<script type="text/javascript">
ShopifyApp.init({
apiKey: 'YOUR_APP_API_KEY',
shopOrigin: 'https://CURRENT_LOGGED_IN_SHOP.myshopify.com'
});
</script>
</head>
有一種方法來提供red.render(req.url, data)
數據,但我不知道我應該從一個組件內用它做。有沒有辦法從組件內訪問和更改全局變量ShopifyApp
?