浏览代码

docs: update the new `logger` plugin export path (#1784)

Kia King Ishii 4 年之前
父节点
当前提交
dbcbb112a7
共有 1 个文件被更改,包括 17 次插入1 次删除
  1. 17 1
      docs/guide/plugins.md

+ 17 - 1
docs/guide/plugins.md

@@ -92,13 +92,17 @@ The plugin will be used by default. For production, you will need [DefinePlugin]
 Vuex comes with a logger plugin for common debugging usage:
 
 ``` js
-import createLogger from 'vuex/dist/logger'
+import { createLogger } from 'vuex'
 
 const store = new Vuex.Store({
   plugins: [createLogger()]
 })
 ```
 
+:::warning WARNING
+Before v3.5.0, the `createLogger` function is exported at `vuex/dist/logger` package. PLease checkout the "Before Vuex v3.5.0" setion of this page.
+:::
+
 The `createLogger` function takes a few options:
 
 ``` js
@@ -137,3 +141,15 @@ const logger = createLogger({
 The logger file can also be included directly via a `<script>` tag, and will expose the `createVuexLogger` function globally.
 
 Note the logger plugin takes state snapshots, so use it only during development.
+
+#### Before Vuex v3.5.0
+
+Before v3.5.0, the `createLogger` function is exported at `vuex/dist/logger` package.
+
+``` js
+import createLogger from 'vuex/dist/logger'
+
+const store = new Vuex.Store({
+  plugins: [createLogger()]
+})
+```