File tree 5 files changed +54
-45
lines changed
5 files changed +54
-45
lines changed Original file line number Diff line number Diff line change
1
+ name : CI
2
+ on :
3
+ push :
4
+ branches :
5
+ - master
6
+
7
+ jobs :
8
+ build :
9
+ runs-on : ubuntu-latest
10
+ steps :
11
+ - uses : actions/checkout@v1
12
+ - uses : actions/setup-node@v1
13
+ with :
14
+ node-version : 12
15
+ registry-url : https://registry.npmjs.org/
16
+ - run : npm install
17
+ - run : npm publish --access public
18
+ env :
19
+ NODE_AUTH_TOKEN : ${{secrets.NPM_TOKEN}}
Original file line number Diff line number Diff line change 1
1
# vue-dark-mode-switch
2
2
3
- ## Project setup
3
+ ## Install
4
4
```
5
- npm install
5
+ npm install --save vue-dark-mode-switch
6
6
```
7
7
8
- ### Compiles and hot-reloads for development
9
- ```
10
- npm run serve
11
- ```
8
+ ### Usage
12
9
13
- ### Compiles and minifies for production
14
- ```
15
- npm run build
16
- ```
10
+ Import the ` DarkModeSwitch ` component, and it will emit its state through ` @switched ` event method.
17
11
18
- ### Lints and fixes files
19
- ```
20
- npm run lint
21
- ```
12
+ ``` html
13
+ <template >
14
+ <DarkModeSwitch @switched =" onSwitched" />
15
+ </template >
16
+
17
+ <script >
18
+ import DarkModeSwitch from ' ./components/DarkModeSwitch.vue'
22
19
23
- ### Customize configuration
24
- See [ Configuration Reference] ( https://cli.vuejs.org/config/ ) .
20
+ export default {
21
+ components: {
22
+ DarkModeSwitch
23
+ },
24
+ methods: {
25
+ onSwitched : function (isSwitched ) {
26
+ console .log (' dark mode is enabled :' , isSwitched);
27
+ }
28
+ }
29
+ }
30
+ </script >
31
+ ```
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " vue-dark-mode-switch" ,
3
- "version" : " 1.0.0 " ,
3
+ "version" : " 1.0.1 " ,
4
4
"author" : " Ismaïl NGUYEN <nguyen.ismail@gmail.com>" ,
5
5
"repository" : " https://github.com/ismailnguyen/vue-dark-mode-switch.git" ,
6
6
"license" : " WTFPL (http://www.wtfpl.net)" ,
7
+ "main" : " ./dist/vue-dark-mode-switch.common.js" ,
7
8
"scripts" : {
8
9
"serve" : " vue-cli-service serve" ,
9
10
"build" : " vue-cli-service build" ,
11
+ "build-library" : " vue-cli-service build --target lib --name vue-dark-mode-switch ./src/main.js" ,
10
12
"lint" : " vue-cli-service lint"
11
13
},
12
14
"dependencies" : {
42
44
" > 1%" ,
43
45
" last 2 versions" ,
44
46
" not dead"
47
+ ],
48
+ "files" : [
49
+ " dist/*" ,
50
+ " src/*" ,
51
+ " public/*" ,
52
+ " *.json" ,
53
+ " *.js"
45
54
]
46
55
}
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
- import Vue from 'vue'
2
- import App from './App.vue'
1
+ import DarkModeSwitch from './components/DarkModeSwitch.vue'
3
2
4
- Vue . config . productionTip = false
5
-
6
- new Vue ( {
7
- render : h => h ( App ) ,
8
- } ) . $mount ( '#app' )
3
+ export default DarkModeSwitch
You can’t perform that action at this time.
0 commit comments