1.1.0 • Published 2 years ago

@luckrya/icon-box-vue v1.1.0

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

@luckrya/icon-box-vue

Vue Svg Icon Components

安装

npm install @luckrya/icon-box-vue

全量引入

import Vue from "vue";
import IconBox from "@luckrya/icon-box-vue";
import App from "./App.vue";

Vue.use(IconBox);

new Vue({
  el: "#app",
  render: (h) => h(App),
});

引用图标

<template>
  <AlertFilled :size="24" />
</template>

<script>
  import { AlertFilled } from "@luckrya/icon-box-vue";

  export default {
    components: {
      AlertFilled,
    },
  };
</script>

自动按需引用图标

可以使用 babel-plugin-import 来按需加载图标。 配置 .babelrc

{
  "plugins": [
    [
      "import",
      {
        "libraryName": "@luckrya/icon-box-vue",
        "libraryDirectory": "build/esm/icons"
      }
    ]
  ]
}
import { AlertFilled } from "@luckrya/icon-box-vue";
////                  👇🏻                        ////
import AlertFilled from "@luckrya/icon-box-vue/build/esm/icons/alert-filled";

属性

属性名称说明类型默认值
size图标的大小,宽高相同number, string'24px'
color图标的颜色,string'currentColor'
1.1.0

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago