-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
134 lines (122 loc) · 4.56 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Vue-notice</title>
<link href="http://cdn.bootcss.com/pure/0.6.0/pure-min.css" rel="stylesheet">
<link href="http://cdn.bootcss.com/pure/0.6.0/grids-responsive-min.css" rel="stylesheet">
<link href="http://fonts.googleapis.com/css?family=Dosis:300,500&text=Vue-notice" rel="stylesheet">
<link href="http://cdn.bootcss.com/highlight.js/9.3.0/styles/rainbow.min.css" rel="stylesheet">
<link href="style/index.css" rel="stylesheet">
<script src="http://cdn.bootcss.com/highlight.js/9.3.0/highlight.min.js"></script>
<script src="http://cdn.bootcss.com/highlight.js/9.3.0/languages/javascript.min.js"></script>
<script src="http://cdn.bootcss.com/vue/1.0.24/vue.min.js"></script>
<script src="script/index.js"></script>
<script type="text/javascript">
hljs.initHighlightingOnLoad()
var options = {
// notice duration, default is 5000
duration: 3000,
// global style, based on built-in style
style: {
fontSize: '14px'
},
// global themes, will overide corresponding built-in theme
themes: {
// will override
info: {
color: 'blue'
},
// will create new theme
rainbow: {
backgroundImage: 'linear-gradient(to right, red, orange, yellow, green, blue, indigo, violet)',
color: 'white'
}
}
}
Vue.use(VueNotice, options)
var vue = new Vue({ el: 'body' })
</script>
</head>
<body>
<div class="pure-g wrapper">
<div class="pure-u-md-1-5"></div>
<div class="pure-u-1 pure-u-md-3-5">
<header>
<h1>Vue-notice</h1>
<p>
A notice plug-in for Vue
</p>
</header>
<section>
<h2>Installation</h2>
<pre><code class="javascript">import Vue from 'vue'
import VueNotice from 'vue-notice'
Vue.use(VueNotice, options)</code></pre>
</section>
<section>
<h2>Global Options</h2>
<pre><code class="javascript">var options = {
// notice duration, default is 5000
duration: 3000,
// global style, based on built-in style
style: {
fontSize: '14px'
},
// global themes, will overide corresponding built-in theme
themes: {
// will override
info: {
color: 'blue'
},
// will create new theme
rainbow: {
backgroundImage: 'linear-gradient(to right, red, orange, yellow, green, blue, indigo, violet)',
color: 'white'
}
}
}</code></pre>
</section>
<section>
<h2>Basic Usage</h2>
<p>
After install Vue-notice, you can easily use <code>$notice</code> method in any Vue instance
</p>
<pre><code class="javascript">// default
this.$notice('content')
// with style (success, info, warning, error supported)
this.$notice('warning', 'warning')
// with customized style in global options
this.$notice('WOW!', 'rainbow')</code></pre>
<div>
Try it out:
<button class="pure-button" onclick="vue.$notice('default')">Default</button>
<button class="pure-button" onclick="vue.$notice('success', 'success')">Success</button>
<button class="pure-button" onclick="vue.$notice('info', 'info')">Info(Overrided)</button>
<button class="pure-button" onclick="vue.$notice('warning', 'warning')">Warning</button>
<button class="pure-button" onclick="vue.$notice('error', 'error')">Error</button>
<button class="pure-button" onclick="vue.$notice('WOW!', 'rainbow')">Rainbow(Customized)</button>
</div>
</section>
<section>
<h2>Advanced Usage</h2>
<pre><code class="javascript">// instace options
// duration
this.$notice('content', { duration: 1000, style: 'success' })
// customize style
this.$notice('content', { style: { color: 'white', background: 'black' }})</code></pre>
<div>
Try it out:
<button class="pure-button" onclick="vue.$notice('content', { duration: 1000, style: 'success' })">1s Duration</button>
<button class="pure-button" onclick="vue.$notice('content', { style: { color: 'white', background: 'black' }})">Customize Style</button>
</div>
</section>
<footer>
Brought to you by <a href="http://www.zjy.name">Zhang Visper</a>
</footer>
</div>
<div class="pure-u-md-1-5"></div>
</div>
</body>
</html>