From: Eduardo San Martin Morote Date: Tue, 9 Feb 2021 10:27:20 +0000 (+0100) Subject: docs: escapeHTML note X-Git-Tag: v2.0.0-alpha.8~99 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4e85f42b19d25ea2f89de1e77ddbd944e74bea00;p=thirdparty%2Fvuejs%2Fpinia.git docs: escapeHTML note --- diff --git a/README.md b/README.md index 98810309..248867c5 100644 --- a/README.md +++ b/README.md @@ -318,8 +318,9 @@ app.use(pinia) // after rendering the page, the root state is build and can be read // serialize, escape (VERY important if the content of the state can be changed // by the user, which is almost always the case), and place it somewhere on -// the page, for example, as a global variable. -JSON.stringify(pinia.state.value) +// the page, for example, as a global variable. Note you need to use your own +// `escapeHTML()` function or use an existing package +escapeHTML(JSON.stringify(pinia.state.value)) ``` On client side, you must hydrate pinia's state before calling any `useStore()` function. For example, if we serialize the state into a `