Skip to content

Instantly share code, notes, and snippets.

@nabrown
Created July 27, 2018 22:16
Show Gist options
  • Save nabrown/3b00c19446bef56d1d844a103abb71ae to your computer and use it in GitHub Desktop.
Save nabrown/3b00c19446bef56d1d844a103abb71ae to your computer and use it in GitHub Desktop.
Standard, single-file component
<template>
<figure :class="type" v-on:click="$emit('click')">
<img :src="src" />
<figcaption v-if="$slots.default">
<span><slot></slot></span>
</figcaption>
<div class="tags" v-if="tags && type != 'framed'">
<span v-for="tag in tags"> {{ tag }}</span>
</div>
</figure>
</template>
<script>
export default {
name: 'FigureStandardSFC',
props: {
src: {
required: true,
type: String
},
type: {
required: true,
type: String
},
tags: {
required: false,
type: Array
}
}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment