はじめに
自作のnpmパッケージを参照するときにエントリポイントを複数公開して、別のパッケージでimport
したかった。しかし、モジュール '***/***/***' またはそれに対応する型宣言が見つかりません。
となり、importに失敗したため、調査結果をメモする。
Web APIを実行するときに、Cookieに認証情報を保持している場合、PostmanやVSCodeのREST ClientなどのツールでAPI実行がうまくいかなかった。
ブラウザのDeveloper ToolsからJavaScriptでAPIを実行する方法で解決できたので、メモする。
// 例 // 認証情報はCookieに入っている前提 (await fetch("https://hoge.example.com/items/add/123", { method: 'POST' })).text();
Reflect.construct()
を利用することで、インスタンス生成が楽JavaScript DAO pattern with Reflect
LWCで構築されたExperience Builder Siteでブラウザの履歴操作をさせたくないケースがあったので、検証してみた。
[NavigationMixin.Navigate](pageReference,[replace])
の第二引数をtrue
に設定する。To dispatch the navigation request, call the navigation service’s
[NavigationMixin.Navigate](pageReference, [replace])
function. If replace is set totrue
, the pageReference replaces the existing entry in the browser history so the user doesn’t have to press the back button twice. The default value isfalse
.
引用:https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.use_navigate_basic
import { LightningElement } from 'lwc'; import { NavigationMixin } from 'lightning/navigation'; export default class Page1 extends NavigationMixin(LightningElement) { goToNextPage() { this[NavigationMixin.Navigate]({ type: 'comm__namedPage', attributes: { name: 'page2__c' } }, true); } }
true
(履歴なし)
false
(履歴あり)
Component Reference
にパラメータの説明書いて...Microsoftが出しているOfficeアドイン。 https://appsource.microsoft.com/ja/product/office/wa104380862
Office系APIがJavaScriptで操作できる。 用途としては、Officeアドインのプロトタイプ開発向けやAPI学習向けなどの記載がある。
企業によってはOfficeアドインの利用が制限されているが、自分の環境ではこのアドインはインポートできた。
context.sync()
をコールする必要がある。欲しい情報をload()
で設定し、context.sync()
をコールする。Copy to clipboard
でどこかにエクスポートする。