Created
November 22, 2015 16:10
-
-
Save diverted247/c62d870c0626a33d74e3 to your computer and use it in GitHub Desktop.
Example .vue component writing svg with prop
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<svg xmlns="http://www.w3.org/2000/svg" width="2.5em" height="1em" viewBox="0 0 8 13"> | |
<path d="M6.4 12.7L.3 6.5 6.4.2l1.3 1.3-4.9 5 4.9 4.9z" transform="rotate({{rotation}})" fill="#969696"/> | |
</svg> | |
</template> | |
<script> | |
export default { | |
props:{ | |
rotation:{ | |
type: String, | |
default:'0' | |
} | |
} | |
} | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<iconarrow></iconarrow> | |
<iconarrow rotation="45"></iconarrow> | |
<iconarrow rotation="90"></iconarrow> | |
<iconarrow rotation="180"></iconarrow> | |
</template> | |
<script> | |
import IconArrow from 'IconArrow.vue'; | |
export default { | |
components:{ | |
iconarrow:IconArrow | |
} | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment