File tree 2 files changed +38
-2
lines changed
2 files changed +38
-2
lines changed Original file line number Diff line number Diff line change @@ -106,6 +106,24 @@ const {
106
106
107
107
The properties of current locale have been merged into the root-level properties.
108
108
109
+ ### onContentUpdated
110
+
111
+ - Details:
112
+
113
+ When the content of the markdown file changes, the callback is triggered.
114
+
115
+ This function can only be called during the ` setup ` phase of the component.
116
+
117
+ ``` vue
118
+ <script setup>
119
+ import { onContentUpdated } from 'vuepress/client'
120
+
121
+ onContentUpdated((reason) => {
122
+ console.log(`content updated reason: ${reason}`)
123
+ })
124
+ </script>
125
+ ```
126
+
109
127
## Helpers
110
128
111
129
### defineClientConfig
@@ -126,7 +144,7 @@ const {
126
144
- Also see:
127
145
- [ Advanced > Cookbook > Resolving Routes] ( ../advanced/cookbook/resolving-routes.md )
128
146
129
- ## resolveRoutePath
147
+ ### resolveRoutePath
130
148
131
149
- Details:
132
150
Original file line number Diff line number Diff line change @@ -106,6 +106,24 @@ const {
106
106
107
107
当前 locale 中的配置已经合并到顶层配置中。
108
108
109
+ ### onContentUpdated
110
+
111
+ - 详情:
112
+
113
+ 当 markdown 文件内容发生变化时,触发回调。
114
+
115
+ 该函数仅能在组件的 ` setup ` 阶段被调用。
116
+
117
+ ``` vue
118
+ <script setup>
119
+ import { onContentUpdated } from 'vuepress/client'
120
+
121
+ onContentUpdated((reason) => {
122
+ console.log(`content updated reason: ${reason}`)
123
+ })
124
+ </script>
125
+ ```
126
+
109
127
## 工具函数
110
128
111
129
### defineClientConfig
@@ -126,7 +144,7 @@ const {
126
144
- 参考:
127
145
- [ 深入 > Cookbook > 解析路由] ( ../advanced/cookbook/resolving-routes.md )
128
146
129
- ## resolveRoutePath
147
+ ### resolveRoutePath
130
148
131
149
- 详情:
132
150
You can’t perform that action at this time.
0 commit comments