From 5851f97eb058b3e2df91f9122ba899bc7e4affaf Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Mon, 12 Aug 2019 20:01:38 +0300 Subject: fixed a lot of bugs with emoji picker, improved relevant components --- src/components/tab_switcher/tab_switcher.js | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) (limited to 'src/components/tab_switcher/tab_switcher.js') diff --git a/src/components/tab_switcher/tab_switcher.js b/src/components/tab_switcher/tab_switcher.js index a5fe019c..99428044 100644 --- a/src/components/tab_switcher/tab_switcher.js +++ b/src/components/tab_switcher/tab_switcher.js @@ -4,7 +4,26 @@ import './tab_switcher.scss' export default Vue.component('tab-switcher', { name: 'TabSwitcher', - props: ['renderOnlyFocused', 'onSwitch', 'customActive'], + props: { + renderOnlyFocused: { + required: false, + type: Boolean, + default: false + }, + onSwitch: { + required: false, + type: Function + }, + customActive: { + required: false, + type: String + }, + scrollableTabs: { + required: false, + type: Boolean, + default: false + } + }, data () { return { active: this.$slots.default.findIndex(_ => _.tag) @@ -18,7 +37,8 @@ export default Vue.component('tab-switcher', { }, methods: { activateTab (index, dataset) { - return () => { + return (e) => { + e.preventDefault() if (typeof this.onSwitch === 'function') { this.onSwitch.call(null, index, this.$slots.default[index].elm.dataset) } @@ -85,7 +105,7 @@ export default Vue.component('tab-switcher', {
{tabs}
-
+
{contents}
-- cgit v1.2.3-70-g09d2