@mezereon/ui-components-vue
Version:
UI components for Mezereon - Vue
49 lines (47 loc) • 899 B
JavaScript
import VRuntimeTemplate from 'v-runtime-template'
import BaseItem from '@/mixins/BaseItem.js'
export default {
components: {
VRuntimeTemplate
},
mixins: [BaseItem],
props: {
queryId: {
type: String,
required: true
},
source: {
type: String,
required: true
},
primaryKey: {
type: String,
required: true
},
html: {
type: String,
required: false
},
layout: {
type: String,
required: true,
validator: (value) => {
return ['horizontal', 'vertical'].includes(value)
}
},
template: {
type: String,
required: true
}
},
methods: {
trackClick() {
this.$emit('recommendation-click', {
queryId: this.queryId,
source: this.source,
uid: this.item[this.primaryKey] + '',
pos: this.index + 1
})
}
}
}