infojune.old/src/components/SoftBox.vue

52 lines
853 B
Vue
Raw Normal View History

2020-02-09 19:02:08 +01:00
<template>
<div id="softbox">
<img width="200px" :src="getImgUrl(img)" :alt='name'>
2020-02-09 19:02:08 +01:00
<h3>{{name}}</h3>
<p>{{desc}}</p>
2020-05-03 19:04:25 +02:00
<div class="btn-container-softbox">
2020-05-31 18:44:24 +02:00
<a class="sb button buttons" v-for="item in href_array" :key="item" target="_blank" :href="item"></a>
2020-05-03 19:04:25 +02:00
</div>
2020-02-09 19:02:08 +01:00
</div>
</template>
<script>
2020-02-09 19:02:08 +01:00
export default {
2020-05-03 19:04:25 +02:00
created: function(){
this.split();
},
2020-02-09 19:02:08 +01:00
props: {
img:String,
name:String,
desc:String,
href:String,
pubkey:String,
2020-02-09 19:02:08 +01:00
},
methods: {
getImgUrl(pic) {
return require('../assets/'+pic)
},
2020-05-03 19:04:25 +02:00
split: function(){
this.href_array = this.href.split(",");
}
}
2020-02-09 19:02:08 +01:00
}
</script>
<style>
#softbox{
2020-02-09 19:02:08 +01:00
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
2020-05-03 19:04:25 +02:00
.btn-container-softbox{
display:grid;
grid-template-columns: repeat(2, 50%);
}
.buttons{
margin-right:10px;
}
2020-02-09 19:02:08 +01:00
</style>