如何更改 swpath 值?

How do I change the swpath value?

<!DOCTYPE html>
...
<head>
<script type="module">
   import 'https://cdn.jsdelivr.net/npm/@pwabuilder/pwaupdate';
   const el = document.createElement('pwa-update');
   document.body.appendChild(el);
</script>
...
</head>

我尝试根据此文档 (https://github.com/pwa-builder/pwabuilder-web/blob/V2/src/assets/next-steps.md) 将 PWA 应用于我的站点。但是,这并没有按预期工作,查看浏览器的调试工具后我发现我需要更改 swpath.

的值

我尝试了各种方法更改swpath的值,但都失败了,而且版本库只说swpath的值存在,但没有告诉我如何更改它。我想知道如何更改 swpath.

的值
<!DOCTYPE html>
<head>
...
<script type="module">
   import 'https://cdn.jsdelivr.net/npm/@pwabuilder/pwaupdate';
   const el = document.createElement('pwa-update');
   el.swpath = "/pwabuilder-sw.js";
   document.body.appendChild(el);
</script>
...
</head>

我用上面的代码解决了问题