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>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.6.10/vue.js"></script>
</head>
<body>
  <div id="app">
    <div class="left">
      <button @click="currentView = 'channel-1'">Channel 1</button>
      <button @click="currentView = 'channel-2'">Channel 2</button>
      <button @click="currentView = 'channel-3'">Channel 3</button>
    </div>
    <div class="right">
      <keep-alive>
        <component :is="currentView"></component>
      </keep-alive>
    </div>
  </div>
  <script type="text/x-template" id="channel_1">
    <div class="channel">
      <h2>Channel 1</h2>
      <p>{{count}}</p>
      <button @click="count++">plus</button>
    </div>
  </script>
  <script type="text/x-template" id="channel_2">
    <div class="channel">
      <h2>Channel 2</h2>
      <p>{{count}}</p>
    </div>
  </script>
  <script type="text/x-template" id="channel_3">
    <div class="channel">
      <h2>Channel 3</h2>
      <p>{{count}}</p>
    </div>
  </script>
</body>
</html>
Output

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

Dismiss x
public
Bin info
chun-wenpro
0viewers