Getting Started with Vue.js
MDI can be used in conjunction with the Vue Icon Component. See the README in the repo for more usage information.
-
Install from NPM.
npm install @mdi/light-js @jamescoyle/vue-icon
-
Import into your project.
import SvgIcon from '@jamescoyle/vue-icon'; import { mdilAccount } from '@mdi/light-js';
The following example shows how you might use an icon within a single file component.
<template> <svg-icon type="mdil" :path="path"></svg-icon> </template> <script> import SvgIcon from '@jamescoyle/vue-icon'; import { mdilAccount } from '@mdi/light-js'; export default { name: "my-cool-component", components: { SvgIcon }, data() { return { path: mdilAccount, } } } </script>