mirror of
https://gitlab.com/bramw/baserow.git
synced 2024-11-21 23:37:55 +00:00
49 lines
1003 B
Vue
49 lines
1003 B
Vue
<template>
|
|
<div class="dropdown" :class="{ 'dropdown--large': !small }">
|
|
<a
|
|
ref="pickerLink"
|
|
class="dropdown__selected"
|
|
@click="$refs.pickerContext.toggle($refs.pickerLink, 'bottom', 'left', 2)"
|
|
>
|
|
<i class="dropdown__selected-icon" :class="icon" />
|
|
<span class="dropdown__selected-text">{{ name }}</span>
|
|
<i class="dropdown__toggle-icon iconoir-nav-arrow-down"></i>
|
|
</a>
|
|
<Context
|
|
ref="pickerContext"
|
|
class="picker__context"
|
|
overflow-scroll
|
|
max-height-if-outside-viewport
|
|
>
|
|
<slot :hide-picker="hide" />
|
|
</Context>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
name: 'Picker',
|
|
props: {
|
|
name: {
|
|
type: String,
|
|
required: true,
|
|
},
|
|
icon: {
|
|
type: String,
|
|
required: false,
|
|
default: '',
|
|
},
|
|
small: {
|
|
type: Boolean,
|
|
required: false,
|
|
default: false,
|
|
},
|
|
},
|
|
methods: {
|
|
hide() {
|
|
this.$refs.pickerContext.hide()
|
|
},
|
|
},
|
|
}
|
|
</script>
|