File tree Expand file tree Collapse file tree 2 files changed +62
-2
lines changed Expand file tree Collapse file tree 2 files changed +62
-2
lines changed Original file line number Diff line number Diff line change @@ -20,11 +20,13 @@ You can find a few examples and the documentation [here](https://eliep.github.io
20
20
` npm install vue-avatar `
21
21
22
22
## Usage
23
+ vue-avatar is a UMD module, which can be used as a module in both CommonJS and AMD modular environments.
24
+ When in non-modular environment, Avatar will be registered as a global variable.</p >
23
25
24
26
### ES6
25
27
``` js
26
28
27
- import Avatar from ' vue-avatar'
29
+ import Avatar from ' vue-avatar/dist/Avatar '
28
30
29
31
export default {
30
32
...
@@ -41,9 +43,35 @@ After that, you can use it in your templates:
41
43
```
42
44
43
45
### ES5
46
+ ``` js
47
+ var Vue = require (' vue' )
48
+ var Avatar = require (' vue-avatar' )
49
+
50
+ var YourComponent = Vue .extend ({
51
+ ...
52
+ components: {
53
+ ' avatar' : Avatar .Avatar
54
+ },
55
+ ...
56
+ })
57
+ ```
44
58
45
59
### Browser
46
60
61
+ ```
62
+ <script src="path/to/vue/vue.min.js"></script>
63
+ <script src="path/to/vue-avatar/dist/vue-avatar.min.js"></script>
64
+
65
+ new Vue({
66
+ ...
67
+ components: {
68
+ 'avatar': Avatar.Avatar
69
+ },
70
+ ...
71
+ })
72
+ ```
73
+
74
+
47
75
## Props
48
76
<table class =" table " >
49
77
<thead ><tr >
Original file line number Diff line number Diff line change @@ -74,11 +74,13 @@ <h2>Installation</h2>
74
74
< pre > < code class ="language-html "> npm install vue-avatar</ code > </ pre >
75
75
76
76
< h2 > Usage</ h2 >
77
+ < p > vue-avatar is a UMD module, which can be used as a module in both CommonJS and AMD modular environments.
78
+ When in non-modular environment, Avatar will be registered as a global variable.</ p >
77
79
78
80
< h3 > ES6</ h3 >
79
81
80
82
< pre > < code class ="language-javascript ">
81
- import Avatar from 'vue-avatar'
83
+ import Avatar from 'vue-avatar/dist/Avatar '
82
84
83
85
export default {
84
86
@@ -94,6 +96,36 @@ <h3>ES6</h3>
94
96
< p > which will render to:</ p >
95
97
< avatar username ="Jane Doe "> </ avatar >
96
98
99
+
100
+
101
+ < h3 > ES5</ h3 >
102
+
103
+ < pre > < code class ="language-javascript ">
104
+ var Vue = require('vue')
105
+ var Avatar = require('vue-avatar')
106
+
107
+ var YourComponent = Vue.extend({
108
+ components: {
109
+ 'avatar': Avatar.Avatar
110
+ }
111
+ })
112
+ </ code > </ pre >
113
+
114
+
115
+
116
+ < h3 > Browser</ h3 >
117
+
118
+ < pre > < code class ="language-html ">
119
+ <script src="path/to/vue/vue.min.js"></script>
120
+ <script src="path/to/vue-avatar/dist/vue-avatar.min.js"></script>
121
+
122
+ new Vue({
123
+ components: {
124
+ 'avatar': Avatar.Avatar
125
+ }
126
+ })
127
+ </ code > </ pre >
128
+
97
129
< h2 > Props</ h2 >
98
130
< table class ="table ">
99
131
< thead > < tr >
You can’t perform that action at this time.
0 commit comments