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: source/guide/extending.md
+17-17Lines changed: 17 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -3,9 +3,9 @@ type: guide
3
3
order: 14
4
4
---
5
5
6
-
## Extend with Mixins
6
+
## 使用 Mixin 进行扩展
7
7
8
-
Mixins are a flexible way to distribute reusable functionalities for Vue components. You can write a mixin just like a normal Vue component option object:
var component =newComponent() // -> "hello from mixin!"
31
31
```
32
32
33
-
## Extend with Plugins
33
+
## 使用插件进行扩展
34
34
35
-
Plugins usually adds global-level functionality to Vue.
35
+
通常插件会为 Vue 添加一个全局的功能。
36
36
37
-
### Writing a Plugin
37
+
### 撰写插件
38
38
39
-
There are typically several types of plugins you can write:
39
+
你可以撰写以下几种典型类型的插件:
40
40
41
-
1.Add one or more global methods. e.g.[vue-element](https://github.com/vuejs/vue-element)
42
-
2.Add one or more global assets: directives/filters/transitions etc. e.g.[vue-touch](https://github.com/vuejs/vue-touch)
43
-
3.Add some Vue instance methods by attaching them to Vue.prototype. The convention here is Vue instance methods should be prefixed with `$`, so that they don't conflict with user data and methods.
0 commit comments