Skip to content
This repository has been archived by the owner on May 25, 2018. It is now read-only.

Emit "collapse" event on Navbar click or blur (issue #487) #494

Open
wants to merge 2 commits into
base: v2
Choose a base branch
from

Conversation

neilsmind
Copy link

@neilsmind neilsmind commented Jun 15, 2017

We needed this for a current project so went ahead and built it.
Hope it can help the project.

<template>
  <navbar placement="top" v-on:collapse="collapse"> <!-- <------- Here's the custom event
  ...
  </navbar>
</template>

<script>
import { navbar, dropdown } from 'vue-strap';

export default {
  data: function data() {
    return {
      collapsed: true,
    };
  },
  components: {
    navbar,
    dropdown,
  },
  methods: {
    collapse() { // <-- This is the function called on the event
      this.collapsed = true;
    },
  },
};
</script>

What does it do?

  • Emits collapse event on blur of navbar
  • Emits collapse event on click of menu item

What else should I know?

  • Based on Vue2 branch

Related Issues

cc: @wffranco @yuche @shaoxiong789

@neilsmind neilsmind changed the title Emit collapse event on Navbar click or blur (issue #487) Emit "collapse" event on Navbar click or blur (issue #487) Jun 15, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant