Skip to content

Commit

Permalink
expand data argument to remove need of array
Browse files Browse the repository at this point in the history
  • Loading branch information
redsuperbat committed Mar 26, 2021
1 parent ac7d4b4 commit c32a79b
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 15 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,17 @@ iconpacks/gameicons/
*.zip
.yarnrc
.npmrc

docs/dist/
package/*/dist/
package/*/dist-css/
package/dist/*/*.js
package/dist-css/*/*.js
package/dist-css/*/*.css


# vscode settings
.vscode

# Logs
logs
*.log
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ import App from "./App.vue";
import OhVueIcon from "oh-vue-icons";

import { FaFlag, RiZhihuFill } from "oh-vue-icons/icons";
OhVueIcon.add([FaFlag, RiZhihuFill]);
OhVueIcon.add(FaFlag, RiZhihuFill);

Vue.component("v-icon", OhVueIcon);

Expand Down Expand Up @@ -109,7 +109,7 @@ import App from "./App.vue";
import OhVueIcon from "oh-vue-icons/dist/v3/icon.umd.min";

import { FaFlag, RiZhihuFill } from "oh-vue-icons/icons";
OhVueIcon.add([FaFlag, RiZhihuFill]);
OhVueIcon.add(FaFlag, RiZhihuFill);

const app = createApp(App);
app.component("v-icon", OhVueIcon);
Expand Down
6 changes: 2 additions & 4 deletions package/icon-v2/src/components/Icon.js
Original file line number Diff line number Diff line change
Expand Up @@ -269,10 +269,8 @@ export default {
if (!icons[name].minY) icons[name].minY = 0;
},

add(data) {
if (Array.isArray(data)) {
for (let icon of data) this.register(icon);
} else this.register(data);
add(...data) {
for (const icon of data) this.register(icon);
},

icons
Expand Down
4 changes: 2 additions & 2 deletions package/icon-v2/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
RiSailboatLine
} from "../../icons";

OhVueIcon.add([
OhVueIcon.add(
FaFlag,
FcLinux,
BiBattery,
Expand All @@ -40,7 +40,7 @@ OhVueIcon.add([
BiLightning,
HiAcademicCap,
RiSailboatLine
]);
);

OhVueIcon.add({
name: "baidu",
Expand Down
6 changes: 2 additions & 4 deletions package/icon-v3/src/components/Icon.js
Original file line number Diff line number Diff line change
Expand Up @@ -270,10 +270,8 @@ export default {
if (!icons[name].minY) icons[name].minY = 0;
},

add(data) {
if (Array.isArray(data)) {
for (let icon of data) this.register(icon);
} else this.register(data);
add(...data) {
for (const icon of data) this.register(icon)
},

icons
Expand Down
4 changes: 2 additions & 2 deletions package/icon-v3/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
RiSailboatLine
} from "../../icons";

OhVueIcon.add([
OhVueIcon.add(
FaFlag,
FcLinux,
BiBattery,
Expand All @@ -40,7 +40,7 @@ OhVueIcon.add([
BiLightning,
HiAcademicCap,
RiSailboatLine
]);
);

OhVueIcon.add({
name: "baidu",
Expand Down

0 comments on commit c32a79b

Please sign in to comment.