浏览代码

Update persist.md (#1855)

Mention issue with type changes
John F 3 年之前
父节点
当前提交
67f6edb275
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      packages/docs/src/en/plugins/persist.md

+ 5 - 0
packages/docs/src/en/plugins/persist.md

@@ -107,6 +107,11 @@ Now change the "count" in the following example and observe the changes made by
 </div>
 </div>
 <!-- END_VERBATIM -->
 <!-- END_VERBATIM -->
 
 
+$persist works with primitive values as well as with arrays and objects.
+However, it is worth noting that localStorage must be cleared when the type of the variable changes.
+
+Given the previous example, if we change count to a value of $persist({value: 0}), then localStorage must be cleared or the variable 'count' renamed.
+
 <a name="custom-key"></a>
 <a name="custom-key"></a>
 ## Setting a custom key
 ## Setting a custom key