Skip to content

Commit 8836e76

Browse files
authored
Merge pull request #68 from coolzjy/2.0-cn
Translate API/Instance Properties
2 parents 0632023 + bd3ef9e commit 8836e76

File tree

1 file changed

+46
-46
lines changed

1 file changed

+46
-46
lines changed

src/api/index.md

Lines changed: 46 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -835,37 +835,37 @@ All lifecycle hooks automatically have their `this` context bound to the instanc
835835

836836
- **另见:** [Functional Components](/guide/render-function.html#Functional-Components)
837837

838-
## Instance Properties
838+
## 实例属性
839839

840840
### vm.$data
841841

842-
- **Type:** `Object`
842+
- **类型:** `Object`
843843

844-
- **Details:**
844+
- **详细:**
845845

846-
The data object that the Vue instance is observing. The Vue instance proxies access to the properties on its data object.
846+
Vue 实例观察的数据对象。Vue 实例代理了对其 data 对象属性的访问。
847847

848-
- **See also:** [Options - data](#data)
848+
- **另见:** [选项 - data](#data)
849849

850850
### vm.$el
851851

852-
- **Type:** `HTMLElement`
852+
- **类型:** `HTMLElement`
853853

854-
- **Read only**
854+
- **只读**
855855

856-
- **Details:**
856+
- **详细:**
857857

858-
The root DOM element that the Vue instance is managing.
858+
Vue 实例使用的根 DOM 元素。
859859

860860
### vm.$options
861861

862-
- **Type:** `Object`
862+
- **类型:** `Object`
863863

864-
- **Read only**
864+
- **只读**
865865

866-
- **Details:**
866+
- **详细:**
867867

868-
The instantiation options used for the current Vue instance. This is useful when you want to include custom properties in the options:
868+
用于当前 Vue 实例的初始化选项。当选项中需要自定义属性时会有用处:
869869

870870
``` js
871871
new Vue({
@@ -878,47 +878,47 @@ All lifecycle hooks automatically have their `this` context bound to the instanc
878878

879879
### vm.$parent
880880

881-
- **Type:** `Vue instance`
881+
- **类型:** `Vue instance`
882882

883-
- **Read only**
883+
- **只读**
884884

885-
- **Details:**
885+
- **详细:**
886886

887-
The parent instance, if the current instance has one.
887+
父实例,如果当前实例有的话。
888888

889889
### vm.$root
890890

891-
- **Type:** `Vue instance`
891+
- **类型:** `Vue instance`
892892

893-
- **Read only**
893+
- **只读**
894894

895-
- **Details:**
895+
- **详细:**
896896

897-
The root Vue instance of the current component tree. If the current instance has no parents this value will be itself.
897+
当前组件树的根 Vue 实例。如果当前实例没有父实例,属性值将会是其自身。
898898

899899
### vm.$children
900900

901-
- **Type:** `Array<Vue instance>`
901+
- **类型:** `Array<Vue instance>`
902902

903-
- **Read only**
903+
- **只读**
904904

905-
- **Details:**
905+
- **详细:**
906906

907-
The direct child components of the current instance. **Note there's no order guarantee for `$children`, and it is not reactive.** If you find yourself trying to use `$children` for data binding, consider using an Array and `v-for` to generate child components, and use the Array as the source of truth.
907+
当前实例的直接子组件。**需要注意 `$children` 并不保证顺序,也不是响应式的。**如果你发现自己正在尝试使用 `$children` 来进行数据绑定,考虑使用一个数组配合 `v-for` 来生成子组件,并且使用 Array 作为真正的来源。
908908

909909
### vm.$slots
910910

911-
- **Type:** `Object`
911+
- **类型:** `Object`
912912

913-
- **Read only**
913+
- **只读**
914914

915-
- **Details:**
915+
- **详细:**
916916

917-
Used to access content [distributed by slots](/guide/components.html#Content-Distribution-with-Slots). Each [named slot](/guide/components.html#Named-Slots) has its own corresponding property (e.g. the contents of `slot="foo"` will be found at `vm.$slots.foo`). The `default` property contains any nodes not included in a named slot.
917+
用来访问被 [slot 分发](/guide/components.html#Content-Distribution-with-Slots)的内容。每个[具名 slot](/guide/components.html#Named-Slots) 有其响应的属性(例如:`slot="foo"` 中的内容将会在 `vm.$slots.foo` 中被找到)。`default` 属性包括了所有没有被包含在一个具名 slot 中的节点。
918918

919-
Accessing `vm.$slots` is most useful when writing a component with a [render function](/guide/render-function.html).
919+
在使用 [render 函数](/guide/render-function.html)书写一个组件时,访问 `vm.$slots` 最有帮助。
920920

921-
- **Example:**
921+
- **示例:**
922922

923923
```html
924924
<blog-post>
@@ -951,36 +951,36 @@ All lifecycle hooks automatically have their `this` context bound to the instanc
951951
})
952952
```
953953

954-
- **See also:**
955-
- [`<slot>` Component](#slot)
956-
- [Content Distribution with Slots](/guide/components.html#Content-Distribution-with-Slots)
957-
- [Render Functions](/guide/render-function.html)
954+
- **另见:**
955+
- [`<slot>` 组件](#slot)
956+
- [使用 Slots 进行内容分发](/guide/components.html#Content-Distribution-with-Slots)
957+
- [Render 函数](/guide/render-function.html)
958958

959959
### vm.$refs
960960

961-
- **Type:** `Object`
961+
- **类型:** `Object`
962962

963-
- **Read only**
963+
- **只读**
964964

965-
- **Details:**
965+
- **详细:**
966966

967-
An object that holds child components that have `ref` registered.
967+
一个对象,其中包含了所有拥有 `ref` 注册的子组件。
968968

969-
- **See also:**
970-
- [Child Component Refs](/guide/components.html#Child-Component-Refs)
969+
- **另见:**
970+
- [子组件引用](/guide/components.html#Child-Component-Refs)
971971
- [ref](#ref)
972972

973973
### vm.$isServer
974974

975-
- **Type:** `boolean`
975+
- **类型:** `boolean`
976976

977-
- **Read only**
977+
- **只读**
978978

979-
- **Details:**
979+
- **详细:**
980980

981-
Whether the current Vue instance is running on the server.
981+
当前 Vue 实例是否运行于服务器。
982982

983-
- **See also:** [Server-Side Rendering](/guide/ssr.html)
983+
- **另见:** [服务端渲染](/guide/ssr.html)
984984

985985
## Instance Methods / Data
986986

0 commit comments

Comments
 (0)