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/js @jamescoyle/vue-icon
-
Import into your project.
import SvgIcon from '@jamescoyle/vue-icon' import { mdiAccount } from '@mdi/js'
The following example shows how you might use an icon within a single file component.
<template> <svg-icon type="mdi" :path="path"></svg-icon> </template> <script> import SvgIcon from '@jamescoyle/vue-icon'; import { mdiAccount } from '@mdi/js'; export default { name: "my-cool-component", components: { SvgIcon }, data() { return { path: mdiAccount, } } } </script>