Skip to content

Commit 59828b8

Browse files
Ismail NGUYENIsmail NGUYEN
Ismail NGUYEN
authored and
Ismail NGUYEN
committed
Add css inclusion on readme
1 parent 5d860a2 commit 59828b8

File tree

3 files changed

+19
-6
lines changed

3 files changed

+19
-6
lines changed

Diff for: README.md

+9-2
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,23 @@ npm install --save vue-dark-mode-switch
88

99
## Usage
1010
Import the `DarkModeSwitch` component, and it will emit its state through `@switched` event method.
11+
`initalState` props allow to initialize the switch value (optional, default value is false).
1112

1213
```html
1314
<template>
14-
<DarkModeSwitch @switched="onSwitched" />
15+
<DarkModeSwitch @switched="onSwitched" :initialState="isDarkModeEnabled" />
1516
</template>
1617

1718
<script>
18-
import DarkModeSwitch from './components/DarkModeSwitch.vue'
19+
import DarkModeSwitch from 'vue-dark-mode-switch'
20+
import 'vue-dark-mode-switch/dist/vue-dark-mode-switch.css'
1921
2022
export default {
23+
data () {
24+
return {
25+
isDarkModeEnabled: true
26+
}
27+
},
2128
components: {
2229
DarkModeSwitch
2330
},

Diff for: docs/index.html

+9-3
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,20 @@ <h1>VueJS Dark mode switch component</h1>
4545
<div class="green"></div>
4646
</div>
4747
<pre class="language-javascript line-numbers"><code class="language-html">&lt;template&gt;
48-
&lt;DarkModeSwitch @switched="onSwitched" /&gt;
48+
&lt;DarkModeSwitch @switched="onSwitched" :initialState="isDarkModeEnabled" /&gt;
4949
&lt;/template&gt;
5050

5151
&lt;script&gt;
52-
import DarkModeSwitch from './components/DarkModeSwitch.vue'
52+
import DarkModeSwitch from 'vue-dark-mode-switch'
53+
import 'vue-dark-mode-switch/dist/vue-dark-mode-switch.css'
5354

5455
export default {
55-
components: {
56+
data () {
57+
return {
58+
isDarkModeEnabled: true
59+
}
60+
},
61+
components: {
5662
DarkModeSwitch
5763
},
5864
methods: {

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-dark-mode-switch",
3-
"version": "1.0.5",
3+
"version": "1.0.6",
44
"author": "Ismaïl NGUYEN <nguyen.ismail@gmail.com>",
55
"repository": "https://github.com/ismailnguyen/vue-dark-mode-switch.git",
66
"license": "WTFPL (http://www.wtfpl.net)",

0 commit comments

Comments
 (0)