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
+45-45Lines changed: 45 additions & 45 deletions
Original file line number
Diff line number
Diff line change
@@ -1081,19 +1081,19 @@ All lifecycle hooks automatically have their `this` context bound to the instanc
1081
1081
1082
1082
-**See also:**[Vue.delete](#Vue-delete)
1083
1083
1084
-
## Instance Methods / Events
1084
+
## 实例方法/事件
1085
1085
1086
1086
<h3id="vm-on">vm.$on( event, callback )</h3>
1087
1087
1088
-
-**Arguments:**
1088
+
-**参数:**
1089
1089
-`{string} event`
1090
1090
-`{Function} callback`
1091
1091
1092
-
-**Usage:**
1092
+
-**用法:**
1093
1093
1094
-
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.
1152
+
如果 Vue 实例在实例化时没有收到 el 选项,则它处于“未挂载”状态,没有关联的 DOM 元素或片断。可以使用 vm.$mount() 手动地开始挂载/编译未挂载的实例。
1153
1153
1154
-
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.
1154
+
如果没有"elementOrSelector"参数,模板将被创建为文档之外的的片断,需要手工用其它的 DOM 实例方法把它插入文档中。如果 replace 选项为 false,则自动创建一个空 <div>,作为包装元素。
1155
1155
1156
-
The method returns the instance itself so you can chain other instance methods after it.
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.
1185
1185
1186
1186
<h3id="vm-nextTick">vm.$nextTick( callback )</h3>
1187
1187
1188
-
-**Arguments:**
1188
+
-**参数:**
1189
1189
-`{Function} callback`
1190
1190
1191
-
-**Usage:**
1191
+
-**用法:**
1192
1192
1193
-
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.
1193
+
将回调延迟到下次 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.
1224
+
完全销毁一个实例。清理它与其它实例的连接,解绑它的全部指令及事件监听器。
1225
1225
1226
-
Triggers the `beforeDestroy` and `destroyed` hooks.
1226
+
在"beforeDestroy"和"destroyed"之间触发。
1227
1227
1228
-
<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>
1228
+
<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