1
1
mirror of https://github.com/namibia/awesome-cheatsheets.git synced 2024-11-26 23:06:31 +00:00
awesome-cheatsheets/components/BaseShare.vue

64 lines
1.3 KiB
Vue
Raw Normal View History

<!-- *************************************************************************
TEMPLATE
************************************************************************* -->
<template lang="pug">
2018-09-09 21:41:06 +00:00
div(
:data-balloon="'Share on ' + network"
class="c-base-share"
2018-09-09 21:41:06 +00:00
data-balloon-pos="up"
data-balloon-type="mini"
)
2018-09-09 21:41:06 +00:00
img(
@click="onClick"
:src="baseUrl + '/images/components/BaseShare/' + network.toLowerCase() + '.svg'"
2018-09-09 21:41:06 +00:00
class="c-base-share__image"
)
</template>
<!-- *************************************************************************
SCRIPT
************************************************************************* -->
<script>
export default {
props: {
network: {
type: String,
required: true
}
},
data() {
return {
// --> STATE <--
baseUrl: process.env.baseUrl
};
},
methods: {
onClick() {
this.$emit("click", this.network);
}
}
};
</script>
<!-- *************************************************************************
STYLE
************************************************************************* -->
<style lang="scss">
$c: ".c-base-share";
#{$c} {
2018-09-09 21:41:06 +00:00
display: inline-block;
#{$c}__image {
width: 32px;
height: 32px;
cursor: pointer;
}
}
</style>