var template = `

{{title}}

{{excerpt}}

{{id}}

{{tag.name}}
{{hostnameURL}}
`; export default { template: template, props: { id: Number, url: String, title: String, excerpt: String, imageURL: String, hasContent: Boolean, hasArchive: Boolean, index: Number, showId: Boolean, editMode: Boolean, listMode: Boolean, selected: Boolean, tags: { type: Array, default () { return [] } } }, computed: { mainURL() { if (this.hasContent) return `/bookmark/${this.id}/content`; else if (this.hasArchive) return `/bookmark/${this.id}/archive`; else return this.url; }, hostnameURL() { var url = new URL(this.url); return url.hostname.replace(/^www\./, ""); }, thumbnailStyleURL() { return { backgroundImage: `url("${this.imageURL}")` } }, eventItem() { return { id: this.id, index: this.index, } } }, methods: { tagClicked(name) { this.$emit("tag-clicked", name); }, selectBookmark() { this.$emit("select", this.eventItem); }, editBookmark() { this.$emit("edit", this.eventItem); }, deleteBookmark() { this.$emit("delete", this.eventItem); }, updateBookmark() { this.$emit("update", this.eventItem); } } }