Skip to content

Commit 64438e6

Browse files
committed
Added node server and demo example.
1 parent 9805681 commit 64438e6

File tree

11 files changed

+199
-10
lines changed

11 files changed

+199
-10
lines changed

.babelrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"presets": [
3+
["latest", {
4+
"es2015": { "modules": false }
5+
}]
6+
]
7+
}

.gitignore

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
node_modules
1+
.DS_Store
2+
node_modules/
3+
dist/
24
npm-debug.log
3-
.idea
4-
.DS_Store
5+
yarn-error.log
6+
.idea

.npmignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node_modules
2+
.idea
3+
.DS_Store
4+
dist
File renamed without changes.

demo/App.vue

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
<template>
2+
<div id="app">
3+
<img width="400px" src="./assets/logo.png">
4+
<h1></h1>
5+
<h2>Floating Action Button</h2>
6+
<fab :styles="fabStyles"
7+
:actions="fabActions"
8+
@cache="cache"
9+
@alertMe="alert"
10+
></fab>
11+
</div>
12+
</template>
13+
14+
<script>
15+
import FAB from '../src/FAB.vue';
16+
export default {
17+
name: 'app',
18+
components: {
19+
fab: FAB
20+
},
21+
data(){
22+
return {
23+
fabStyles: {
24+
bgColor: '#778899'
25+
},
26+
fabActions: [
27+
{
28+
name: 'cache',
29+
icon: 'cached'
30+
},
31+
{
32+
name: 'alertMe',
33+
icon: 'add_alert'
34+
}
35+
]
36+
}
37+
},
38+
methods: {
39+
cache(){
40+
console.log('Cache Cleared');
41+
},
42+
alert(){
43+
alert('Clicked on alert icon');
44+
}
45+
}
46+
}
47+
</script>
48+
49+
<style scoped>
50+
#app {
51+
font-family: 'Avenir', Helvetica, Arial, sans-serif;
52+
-webkit-font-smoothing: antialiased;
53+
-moz-osx-font-smoothing: grayscale;
54+
text-align: center;
55+
color: #2c3e50;
56+
margin-top: 60px;
57+
}
58+
59+
h1, h2 {
60+
font-weight: normal;
61+
}
62+
63+
64+
li {
65+
display: inline-block;
66+
margin: 0 10px;
67+
}
68+
69+
a {
70+
color: #42b983;
71+
}
72+
</style>

demo/assets/logo.png

61 KB
Loading

demo/main.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import Vue from 'vue'
2+
import App from './App.vue'
3+
4+
new Vue({
5+
el: '#app',
6+
render: h => h(App)
7+
})

index.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
6+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.5.2/animate.min.css">
7+
<title>vue-fab</title>
8+
</head>
9+
<body>
10+
<div id="app"></div>
11+
<script src="./dist/build.js"></script>
12+
</body>
13+
</html>

package.json

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
{
22
"name": "vue-fab",
3-
"version": "1.0.9",
3+
"version": "1.0.10",
44
"description": "Vue Floating Action Button",
55
"main": "src/index.js",
6-
"scripts": {
7-
"test": "echo \"Error: no test specified\" && exit 1"
8-
},
96
"repository": {
107
"type": "git",
118
"url": "https://github.com/PygmySlowLoris/vue-fab"
@@ -31,8 +28,24 @@
3128
"url": "https://github.com/PygmySlowLoris/vue-fab/issues"
3229
},
3330
"homepage": "https://github.com/PygmySlowLoris/vue-fab#readme",
31+
"scripts": {
32+
"dev": "cross-env NODE_ENV=development webpack-dev-server --open --hot",
33+
"build": "cross-env NODE_ENV=production webpack --progress --hide-modules"
34+
},
3435
"dependencies": {
35-
"vue": "^2.2.6",
36+
"vue": "^2.2.1",
3637
"vue-clickaway": "^2.1.0"
38+
},
39+
"devDependencies": {
40+
"babel-core": "^6.0.0",
41+
"babel-loader": "^6.0.0",
42+
"babel-preset-latest": "^6.0.0",
43+
"cross-env": "^3.0.0",
44+
"css-loader": "^0.25.0",
45+
"file-loader": "^0.9.0",
46+
"vue-loader": "^11.1.4",
47+
"vue-template-compiler": "^2.2.1",
48+
"webpack": "^2.2.0",
49+
"webpack-dev-server": "^2.2.0"
3750
}
3851
}

src/FAB.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,9 @@
181181
cursor: pointer;
182182
}
183183
184-
.fab ul {
185-
padding: 0;
184+
ul {
185+
list-style-type: none;
186+
padding: 0 !important;
186187
}
187188
188189
.fab-wrapper .actions-container {

0 commit comments

Comments
 (0)