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: README.md
+45-21Lines changed: 45 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -58,22 +58,11 @@ I would recommend you to create your VUE project using vue-cli, then it should i
58
58
| ------------- | ------------- |
59
59
| message | Message to be shown in loading screen |
60
60
| url | <b>Optional Field</b>, image including svg/gif/png/jpg etc, you can use any animated/static image supported by img tag. Please be aware that you'd better import the image resource then use it instead of directly using relative image path. Example can be found in this document. If <b>url</b> attribute presents and not empty, it will ignore <b>html</b> attribute|
61
-
| html | <b>Optional Field</b>, you can insert html template to icon area, this enables you to utilize external animated fonts/css libaries. eg. [fontawesome](http://fontawesome.io/examples/) or [Spinkit](https://github.com/tobiasahlin/SpinKit) etc. <b>Don't forget to import related css & fonts into project by yourself</b>
61
+
| html | (Deprecated, suggest to use [slot] option instead), <b>Optional Field</b>, you can insert html template to icon area, this enables you to utilize external animated fonts/css libaries. eg. [fontawesome](http://fontawesome.io/examples/) or [Spinkit](https://github.com/tobiasahlin/SpinKit) etc. <b>Don't forget to import related css & fonts into project by yourself</b>
62
+
| [slot] | Directly use any html template or other Vue Component, it will replace the icon part, see examples in readme.
62
63
63
64
Then, you can combine with <b>v-if</b>/<b>v-show</b> to show or hide the BlockUI.
64
65
65
-
## In your template
66
-
Please note the differences of using ":" or not.
67
-
```
68
-
<BlockUI message="Loading..."></BlockUI>
69
-
70
-
or
71
-
72
-
<BlockUI :message="msg" :url="url"></BlockUI>
73
-
74
-
or
75
-
<BlockUI :message="msg" :html="html"></BlockUI>
76
-
```
77
66
78
67
## In your Code
79
68
Please be aware, if you are using webpack and with file-loader to add finger print to your asserts,
@@ -85,18 +74,50 @@ import BlockUI from 'vue-blockui'
85
74
import loadingImage from './assets/logo.png'
86
75
87
76
Vue.use(BlockUI)
77
+
```
78
+
```
79
+
<BlockUI :message="msg" :url="url"></BlockUI>
88
80
89
81
export default {
90
82
name: 'app',
91
83
data () {
92
84
return {
93
85
msg: 'Welcome to Your Vue.js App',
94
-
html: '<i class="fa fa-cog fa-spin fa-3x fa-fw"></i>', //this line demostrate how to use fontawesome animation icon
95
86
url : loadingImage //It is important to import the loading image then use here
96
87
}
97
88
}
98
89
}
99
90
```
91
+
or
92
+
```
93
+
<BlockUI :message="msg" :html="html"></BlockUI>
94
+
95
+
export default {
96
+
name: 'app',
97
+
data () {
98
+
return {
99
+
msg: 'Welcome to Your Vue.js App',
100
+
html: '<i class="fa fa-cog fa-spin fa-3x fa-fw"></i>', //this line demostrate how to use fontawesome animation icon
101
+
}
102
+
}
103
+
}
104
+
```
105
+
106
+
Or using inline html or component **[slot example]**
107
+
```
108
+
<BlockUI :message="msg">
109
+
<i class="fa fa-cog fa-spin fa-3x fa-fw"></i>
110
+
</BlockUI>
111
+
112
+
export default {
113
+
name: 'app',
114
+
data () {
115
+
return {
116
+
msg: 'Welcome to Your Vue.js App',
117
+
}
118
+
}
119
+
}
120
+
```
100
121
101
122
## Styling Customization
102
123
You can override BlockUI sytlings based on your needs.
@@ -134,18 +155,21 @@ Below screen is using spinkit css animation
0 commit comments