Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
   <script src="http://vuejs.org/js/vue.js"></script>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
  <div id="app">
       
    <component is="subcomponent" v-bind="subdata"></component>
     
    <component is="subcomponent" :prop-a="subdata.propA" :prop-b="subdata.propB"></component>
    
  </div>
</body>
</html>
 
window.onload = function () {
    
    Vue.config.debug = true;
    new Vue({
        el: '#app',
      
          data: {
            subdata: {
              propA: 'valA',
              propB: 'valB'
            }
          },
      
        components: {
          
      
          subcomponent: {
      
            props:['propA', 'propB'],
      
            template: '<p>propA: {{ propA }} propB: {{ propB }}</p>'
      
          }
      
        }
      
    });
    
};
Output

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

Dismiss x
public
Bin info
anonymouspro
0viewers