Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
  
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.0.3/vue.js"></script>
  
  
<div id="wrap">
  <header id="navigation-top">
    <nav class="main-navigation"  v-on:click.prevent>
      <button 
         v-for="[label, className] in buttons"
         v-on:click="setActiveClass(className)"
         v-bind:class="{ active: className === activeClass }">
        {{label}}
      </button>
    </nav>
  </header>
  <!-- this is the div that needs to get the class "active" when the button is clicked -->
  <div v-bind:class="activeClass">
    <ul>
      <li><a href="#" class="links">Home</a></li>
      <li><a href="#" class="links">About</a></li>
      <li><a href="#" class="links">Contact</a></li>
    </ul>
  </div>
</div>
  
</body>
</html>
Output 300px

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers