Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <div id="app" class="container">	

		<tabs>
			<tab name="pictures tab" :selected="true">
				<h1>here is the content for the pictures tab.</h1>
			</tab>
			<tab name="music tab">
				<h1>here is the content for the music tab.</h1>
			</tab>
			<tab name="video tab">
				<h1>here is the content for the video tab.</h1>
			</tab>
		</tabs>

	</div>
              
            
!

CSS

              
                *
  margin: 0
  padding: 0
  box-sizing: border-box

html,body
  height: 100%

$bg: #171717
$color: #eee

body
  position: relative
  overflow-x: hidden
  line-height: 1.5
  background: $bg
  color: $color
  font-size: 14px
  text-align: center
  display: flex
  align-items: center
  justify-content: center
  padding-bottom: 20px
  

  
  
              
            
!

JS

              
                Vue.config.devtools = true;


Vue.component('tabs', {
	template: `
		<div>
			<div class="tabs">
			  <ul>
			    <li v-for="tab in tabs" :class="{'is-active' : tab.isActive}"> 
			    	<a :href="tab.href" @click="selectTab(tab)">{{tab.name}}</a>
			    </li>
			  </ul>
			</div>
			<div class="tabs-details">
				<slot></slot>
			</div>
		</div>
	`,
	data(){
		return{
			tabs: []
		};
	},
	created(){
		this.tabs = this.$children;
	},
	methods:{
		selectTab(selectedTab){
			this.tabs.forEach(tab => {
				tab.isActive = (tab.name == selectedTab.name);
			});
		}
	}
});

Vue.component('tab', {
	template: `
		<div v-show="isActive">
      <slot></slot> 
      <i>href : {{href}}</i>
  </div>
	`,
	props: {
		name: {required: true},
		selected: {default: false}
	},
	data(){
		return{
			isActive: false
		}
	},
	computed:{
		href(){
			return '#' + this.name.toLowerCase().replace(/ /g, '-');
		}
	},
	mounted(){
		this.isActive = this.selected;
	}
});


new Vue({
	el: '#app'

});



              
            
!
999px

Console