You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/api/index.md
+47-47Lines changed: 47 additions & 47 deletions
Original file line number
Diff line number
Diff line change
@@ -1083,19 +1083,19 @@ All lifecycle hooks automatically have their `this` context bound to the instanc
1083
1083
1084
1084
-**See also:**[Vue.delete](#Vue-delete)
1085
1085
1086
-
## Instance Methods / Events
1086
+
## 实例方法/事件
1087
1087
1088
1088
<h3id="vm-on">vm.$on( event, callback )</h3>
1089
1089
1090
-
-**Arguments:**
1090
+
-**参数:**
1091
1091
-`{string} event`
1092
1092
-`{Function} callback`
1093
1093
1094
-
-**Usage:**
1094
+
-**用法:**
1095
1095
1096
-
Listen for a custom event on the current vm. Events can be triggered by `vm.$emit`. The callback will receive all the additional arguments passed into these event-triggering methods.
If a Vue instance didn't receive the `el` option at instantiation, it will be in "unmounted" state, without an associated DOM element. `vm.$mount()` can be used to manually start the mounting of an unmounted Vue instance.
1154
+
如果 Vue 实例在实例化时没有收到 el 选项,则它处于“未挂载”状态,没有关联的 DOM 元素或片断。可以使用 vm.$mount() 手动地挂载一个未挂载的实例。
1155
1155
1156
-
If `elementOrSelector` argument is not provided, the template will be rendered as an off-document element, and you will have to use native DOM API to insert it into the document yourself.
Force the Vue instance to re-render. Note it does not affect all child components, only the instance itself and child components with inserted slot content.
1186
+
迫使Vue实例重修渲染。注意它仅仅影响实例本身和插入插槽内容的子组件,而不是所有子组件。
1187
1187
1188
1188
<h3id="vm-nextTick">vm.$nextTick( callback )</h3>
1189
1189
1190
-
-**Arguments:**
1190
+
-**参数:**
1191
1191
-`{Function} callback`
1192
1192
1193
-
-**Usage:**
1193
+
-**用法:**
1194
1194
1195
-
Defer the callback to be executed after the next DOM update cycle. Use it immediately after you've changed some data to wait for the DOM update. This is the same as the global `Vue.nextTick`, except that the callback's `this` context is automatically bound to the instance calling this method.
1195
+
将回调延迟到下次 DOM 更新循环之后执行。在修改数据之后立即使用它,然后等待 DOM 更新。它跟全局方法 Vue.nextTick 一样,不同的是回调的 this 自动绑定到调用它的实例上。
Completely destroy a vm. Clean up its connections with other existing vms, unbind all its directives, turn off all event listeners.
1226
+
完全销毁一个实例。清理它与其它实例的连接,解绑它的全部指令及事件监听器。
1227
1227
1228
-
Triggers the `beforeDestroy` and `destroyed` hooks.
1228
+
在"beforeDestroy"和"destroyed"之间触发。
1229
1229
1230
-
<pclass="tip">In normal use cases you shouldn't have to call this method yourself. Prefer controlling the lifecycle of child components in a data-driven fashion using `v-if` and `v-for`.</p>
0 commit comments