Skip to content

Commit afd25c6

Browse files
author
zhouzhechao
committed
feat: 💡第一版
1 parent 877147b commit afd25c6

File tree

14 files changed

+318
-111
lines changed

14 files changed

+318
-111
lines changed

.eslintrc.js

+1
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@ module.exports = {
1313
rules: {
1414
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
1515
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
16+
'no-plusplus': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
1617
},
1718
};

.npmignore

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
examples/
2+
public/
3+
node_modules
4+
5+
vue.config.js
6+
babel.config.js
7+
*.map

README.md

+34-16
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,42 @@
1-
# vue-firework
1+
## vue-firework
22

3-
## Project setup
4-
```
5-
yarn install
6-
```
3+
> To use the firework component developed by vue, click on the component.
4+
>
5+
Vue 版的点击页面出现火花效果,可以全局也用,也可以在单个元素中使用。
76

8-
### Compiles and hot-reloads for development
9-
```
10-
yarn serve
11-
```
127

13-
### Compiles and minifies for production
14-
```
15-
yarn build
8+
### demo
9+
10+
11+
### install
12+
13+
```sh
14+
# npm
15+
npm install vue-firework --save
16+
# yarn
17+
yarn add vue-firework
1618
```
1719

18-
### Lints and fixes files
20+
### import and use
21+
22+
Import for global usage
23+
```js
24+
import Vue from 'vue'
25+
import VueFirework from 'vue-firework'
26+
27+
Vue.use(VueFirework)
1928
```
20-
yarn lint
29+
Or on a single component
30+
```js
31+
import VueFirework from 'vue-firework'...
32+
components: { VueFirework }
33+
...
2134
```
2235

23-
### Customize configuration
24-
See [Configuration Reference](https://cli.vuejs.org/config/).
36+
### config
37+
* el. The element that needs to bind firework effects.
38+
* fireCanvasStyle. Configuration of firework left and top properties.
39+
40+
### todo
41+
- Custom color
42+
### MIT

example/App.vue

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<template>
2+
<div class="container">
3+
<VueFirework></VueFirework>
4+
5+
<div class="intro">
6+
<h1>To use the firework component developed by vue, click on the component.</h1>
7+
<p>Try clicking on the screen</p>
8+
</div>
9+
10+
<h2>🔥props</h2>
11+
<li>[el]. The element that needs to bind firework effects.</li>
12+
<li>[fireCanvasStyle]. Configuration of firework left and top properties.</li>
13+
14+
<h2>🎉use</h2>
15+
<li>yarn add vue-firework</li>
16+
<li>import Vue from 'vue'</li>
17+
<li>import VueFirework from 'vue-firework'</li>
18+
</div>
19+
</template>
20+
21+
<script>
22+
import VueFirework from '../src/firework.vue';
23+
24+
export default {
25+
components: { VueFirework },
26+
};
27+
</script>
28+
29+
<style>
30+
html,
31+
body {
32+
height: 100%;
33+
font-family: "Pacifico", cursive;
34+
font-family: "Fredoka One", cursive;
35+
}
36+
body {
37+
display: flex;
38+
align-items: center;
39+
justify-content: center;
40+
}
41+
.container {
42+
/* width: 600px; */
43+
height: 600px;
44+
color: #162447;
45+
/* background-color: #f8b195; */
46+
}
47+
48+
.intro {
49+
text-align: center;
50+
}
51+
</style>

example/main.js

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import Vue from 'vue';
2+
import App from './App.vue';
3+
4+
Vue.config.productionTip = false;
5+
6+
new Vue({
7+
render: (h) => h(App),
8+
}).$mount('#app');

package.json

+18-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
{
22
"name": "vue-firework",
33
"version": "0.1.0",
4-
"private": true,
4+
"private": false,
55
"scripts": {
66
"serve": "vue-cli-service serve",
77
"build": "vue-cli-service build",
8-
"lint": "vue-cli-service lint"
8+
"lint": "vue-cli-service lint",
9+
"lib": "vue-cli-service build --target lib --name vue-fi --dest lib ./src/main.js"
910
},
1011
"dependencies": {
12+
"animejs": "^3.2.0",
1113
"core-js": "^3.6.4",
1214
"vue": "^2.6.11"
1315
},
@@ -21,5 +23,18 @@
2123
"eslint-plugin-import": "^2.20.2",
2224
"eslint-plugin-vue": "^6.2.2",
2325
"vue-template-compiler": "^2.6.11"
24-
}
26+
},
27+
"author": "[email protected]",
28+
"description": "To use the firework component developed by vue, click on the component.",
29+
"keywords": [
30+
"vue",
31+
"firework",
32+
"vue-firework"
33+
],
34+
35+
"repository": {
36+
"type": "git",
37+
"url": "项目的git地址"
38+
},
39+
"license": "MIT"
2540
}

public/index.html

+4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
<meta name="viewport" content="width=device-width,initial-scale=1.0">
77
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
88
<title><%= htmlWebpackPlugin.options.title %></title>
9+
<link href="https://fonts.googleapis.com/css2?family=Pacifico&display=swap" rel="stylesheet">
10+
<link href="https://fonts.googleapis.com/css2?family=Fredoka+One&family=Pacifico&display=swap" rel="stylesheet">
11+
12+
913
</head>
1014
<body>
1115
<noscript>

src/App.vue

-28
This file was deleted.

src/assets/logo.png

-6.69 KB
Binary file not shown.

src/components/HelloWorld.vue

-58
This file was deleted.

0 commit comments

Comments
 (0)