cartodb-4.42/lib/assets/javascripts/new-dashboard/components/Settings/Settings.vue

54 lines
955 B
Vue
Raw Normal View History

2024-04-06 13:25:13 +08:00
<template>
<Dropdown ref="dropdown" class="settings">
<template slot="button">
<slot />
</template>
<Filters :section="section" :filter="filter" :metadata="metadata" @filterChanged="setFilter"/>
</Dropdown>
</template>
<script>
import Dropdown from '../Dropdowns/Dropdown';
import Filters from '../Settings/Filters';
export default {
name: 'SettingsDropdown',
components: {
Dropdown,
Filters
},
props: {
section: String,
filter: String,
metadata: {
type: Object,
default () {
return {
total_shared: 0,
total_subscriptions: 0
};
}
}
},
data: function () {
return {
isVisible: false,
isDropdownOpen: false
};
},
methods: {
setFilter (filter) {
this.$refs.dropdown.closeDropdown();
this.$emit('filterChanged', filter);
}
}
};
</script>
<style lang="scss" scoped>
.settings {
position: relative;
}
</style>