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
1.**Side Effects** (triggers effects outside the component)
1283
+
1.**副作用** (触发组件外的影响)
1284
1284
-`el`
1285
1285
1286
-
2.**Global Awareness** (requires knowledge beyond the component)
1286
+
2.**全局感知** (要求组件以外的知识)
1287
1287
-`name`
1288
1288
-`parent`
1289
1289
1290
-
3.**Component Type** (changes the type of the component)
1290
+
3.**组件类型** (更改组件的类型)
1291
1291
-`functional`
1292
1292
1293
-
4.**Template Modifiers** (changes the way templates are compiled)
1293
+
4.**模板修改器** (改变模板的编译方式)
1294
1294
-`delimiters`
1295
1295
-`comments`
1296
1296
1297
-
5.**Template Dependencies** (assets used in the template)
1297
+
5.**模板依赖** (模板内使用的资源)
1298
1298
-`components`
1299
1299
-`directives`
1300
1300
-`filters`
1301
1301
1302
-
6.**Composition** (merges properties into the options)
1302
+
6.**组合** (向选项里合并属性)
1303
1303
-`extends`
1304
1304
-`mixins`
1305
1305
1306
-
7.**Interface** (the interface to the component)
1306
+
7.**接口** (组件的接口)
1307
1307
-`inheritAttrs`
1308
1308
-`model`
1309
1309
-`props`/`propsData`
1310
1310
1311
-
8.**Local State** (local reactive properties)
1311
+
8.**本地状态** (本地的响应式属性)
1312
1312
-`data`
1313
1313
-`computed`
1314
1314
1315
-
9.**Events** (callbacks triggered by reactive events)
1315
+
9.**事件** (通过响应式事件触发的回调)
1316
1316
-`watch`
1317
-
-Lifecycle Events (in the order they are called)
1317
+
-生命周期钩子 (按照它们被调用的顺序)
1318
1318
1319
-
10.**Non-Reactive Properties** (instance properties independent of the reactivity system)
1319
+
10.**非响应式的属性** (不依赖响应系统的实例属性)
1320
1320
-`methods`
1321
1321
1322
-
11.**Rendering** (the declarative description of the component output)
1322
+
11.**渲染** (组件输出的声明式描述)
1323
1323
-`template`/`render`
1324
1324
-`renderError`
1325
1325
1326
1326
1327
1327
1328
-
### Element attribute order <supdata-p="c">recommended</sup>
1328
+
### 元素特性的顺序 <supdata-p="c">推荐</sup>
1329
1329
1330
-
**The attributes of elements (including components) should be ordered consistently.**
1330
+
**元素 (包括组件) 的特性应该有统一的顺序。**
1331
1331
1332
-
This is the default order we recommend for component options. They're split into categories, so you'll know where to add custom attributes and directives.
9.**Content** (overrides the content of the element)
1367
+
9.**内容** (复写元素的内容)
1368
1368
-`v-html`
1369
1369
-`v-text`
1370
1370
1371
1371
1372
1372
1373
-
### Empty lines in component/instance options <supdata-p="c">recommended</sup>
1373
+
### 组件/实例选项中的空行 <supdata-p="c">推荐</sup>
1374
1374
1375
-
**You may want to add one empty line between multi-line properties, particularly if the options can no longer fit on your screen without scrolling.**
1375
+
**你可能想在多个属性之间增加一个空行,特别是在这些选项一屏放不下,需要滚动才能都看到的时候。**
1376
1376
1377
-
When components begin to feel cramped or difficult to read, adding spaces between multi-line properties can make them easier to skim again. In some editors, such as Vim, formatting options like this can also make them easier to navigate with the keyboard.
1377
+
当你的组件开始觉得密集或难以阅读时,在多个属性之间添加空行可以让其变得容易。在一些诸如 Vim 的编辑器里,这样格式化后的选项还能通过键盘被快速导航。
1378
1378
1379
1379
{% raw %}<divclass="style-example example-good">{% endraw %}
1380
1380
#### 好例子
@@ -1407,8 +1407,7 @@ computed: {
1407
1407
```
1408
1408
1409
1409
```js
1410
-
// No spaces are also fine, as long as the component
1411
-
// is still easy to read and navigate.
1410
+
// 没有空行在组件易于阅读和导航时也没问题。
1412
1411
props: {
1413
1412
value: {
1414
1413
type:String,
@@ -1434,9 +1433,9 @@ computed: {
1434
1433
1435
1434
1436
1435
1437
-
### Single-file component top-level element order <supdata-p="c">recommended</sup>
1436
+
### 单文件组件的顶级元素的顺序 <supdata-p="c">推荐</sup>
1438
1437
1439
-
**[Single-file components](../guide/single-file-components.html) should always order `template`, `script`, and`style`tags consistently, with `<style>`last, because at least one of the other two is always necessary.**
0 commit comments