-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit a016f0e
Showing
9 changed files
with
150 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Auto detect text files and perform LF normalization | ||
* text=auto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/node_modules/ | ||
/dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2019 William L | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# vue-loading-button |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import vue from "rollup-plugin-vue"; | ||
import buble from "rollup-plugin-buble"; | ||
import uglify from "rollup-plugin-uglify-es"; | ||
import minimist from "minimist"; | ||
|
||
const argv = minimist(process.argv.slice(2)); | ||
|
||
const config = { | ||
input: "src/index.js", | ||
output: { | ||
name: "VueLoadingButton", | ||
exports: "named" | ||
}, | ||
plugins: [ | ||
vue({ | ||
css: true, | ||
compileTemplate: true | ||
}), | ||
buble() | ||
] | ||
}; | ||
|
||
// minify browser (iife) version | ||
if (argv.format === "iife") { | ||
config.plugins.push(uglify()); | ||
} | ||
|
||
export default config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<template> | ||
<div class="example"> | ||
<VueLoadingButton class="button" /> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import VueLoadingButton from "../src/vue-loading-button.vue"; | ||
export default { | ||
name: "Example", | ||
data() { | ||
return {}; | ||
}, | ||
components: { | ||
VueLoadingButton | ||
} | ||
}; | ||
</script> | ||
|
||
<style scoped> | ||
.example {} | ||
.button {} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"name": "vue-loading-button", | ||
"version": "0.1.0", | ||
"description": "", | ||
"license": "MIT", | ||
"main": "dist/vue-loading-button.umd.js", | ||
"module": "dist/vue-loading-button.esm.js", | ||
"unpkg": "dist/vue-loading-button.min.js", | ||
"browser": { | ||
"./sfc": "src/vue-loading-button.vue" | ||
}, | ||
"scripts": { | ||
"dev": "vue serve ./src/vue-loading-button.vue", | ||
"example": "vue serve ./examples/example.vue", | ||
"build": "npm run build:unpkg & npm run build:es & npm run build:umd", | ||
"build:umd": "rollup --config build/rollup.config.js --format umd --file dist/vue-loading-button.umd.js", | ||
"build:es": "rollup --config build/rollup.config.js --format es --file dist/vue-loading-button.esm.js", | ||
"build:unpkg": "rollup --config build/rollup.config.js --format iife --file dist/vue-loading-button.min.js" | ||
}, | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"minimist": "^1.2.0", | ||
"rollup": "^0.57.1", | ||
"rollup-plugin-buble": "^0.19.2", | ||
"rollup-plugin-uglify-es": "0.0.1", | ||
"rollup-plugin-vue": "^3.0.0", | ||
"vue": "^2.5.16", | ||
"vue-template-compiler": "^2.5.16" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import component from "./vue-loading-button.vue"; | ||
|
||
// install function executed by Vue.use() | ||
export function install(Vue) { | ||
if (install.installed) return; | ||
install.installed = true; | ||
Vue.component("VueLoadingButton", component); | ||
} | ||
|
||
// create module definition for Vue.use() | ||
const plugin = { | ||
install | ||
}; | ||
|
||
// auto-install when vue is found | ||
let GlobalVue = null; | ||
if (typeof window !== "undefined") { | ||
GlobalVue = window.Vue; | ||
} else if (typeof global !== "undefined") { | ||
GlobalVue = global.Vue; | ||
} | ||
if (GlobalVue) { | ||
GlobalVue.use(plugin); | ||
} | ||
|
||
export default component; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<script> | ||
export default { | ||
name: "VueLoadingButton", | ||
data() { | ||
return {}; | ||
} | ||
}; | ||
</script> | ||
|
||
<template> | ||
<div class="vue-loading-button"> | ||
hello world | ||
</div> | ||
</template> | ||
|
||
<style scoped> | ||
</style> |