Skip to content

Instantly share code, notes, and snippets.

View edmondyip's full-sized avatar

Edmond Yip edmondyip

View GitHub Profile
<template>
<svg width="100%" x="0px" y="0px" id="background-svg" xmlns="http://www.w3.org/2000/svg" xml:space="preserve" viewBox="0 0 720 480"
preserveAspectRatio="none">
<g v-for="svg in svgList" :id="svg.name" style="display: none" :key="svg.id">
<path v-for="svgPath in svg.path" :d="svgPath" :key="svgPath.id" />
</g>
</svg>
</template>
@edmondyip
edmondyip / app.js
Created January 23, 2018 03:04
Convert Hex to RGB in Vue Method
data: {
return {
opacity: 50
}
},
methods: {
convertHex: function (color) {
color = color.replace('#', '')
let r = parseInt(color.substring(0, 2), 16)
let g = parseInt(color.substring(2, 4), 16)