Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource


Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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


Save Automatically?

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.


                <h1>Introductory Example For VueJS</h1>
<div class="container-fluid" id="app">
  <div class="row">
    <div class="col-sm-12">
      <p>Binds the data to your view so that so that basically as you type you can see it reflected immediately.</p>
      <div class="well">
               placeholder="Enter some demo text..."
        <!-- Mustache syntax for placing values in the view or you can use the `v-text` directive down below. -->

      <p>Allows you to loop through an array of objects such as a contact list or something.</p>
      <div class="well">
        <div class="form-group">
                 v-on="keyup:createContact | key 'enter'" 
                 placeholder="Type a name and hit enter...">
          <!-- `name` is the property of the indivdual contact, or basically `` without the `contact` -->
          <li v-repeat="contacts">{{name}}</li>
          <!-- Optionally you can use this syntax to access the object via an alias like `contact` -->
          <li v-repeat="contact: contacts" v-text=""></li>

      <p>Lets you place variables inside an element without using the mustache syntax.</p>
      <div class="well">
        <span v-text="vTextSample"></span>
      <p>Will remove the content if false and insert it if true, wheras `v-show` simply sets the `display` to `none`.</p>
      <div class="well">
        <button v-on="click:toggleExample" class="btn btn-primary">Toggle</button>
        <span v-if="showToggleExample">
          Click the button to hide me.

      <p>Allows you to listen to different types of events and event filter for things like only running a function when the enter key is pushed.</p>
      <div class="well">
        <button class="btn btn-primary" v-on="click:openAlert">
          Open Alert


                body {
  margin: 15px;



                // Initializing a new VueJS component
new Vue({
  // The css selector where the app will 
  // be instantiated on the page
  el: '#app', 

  // Variables that you want it to have 
  // access to within your view 
  // and component functions.
  data: {
    filtersMessage: "MOON",
    filtersOrder: "fourth",
    demoText: 'Type some text in here...',
    showToggleExample: 'test',
    contacts: [
        name: 'Michael' 
        name: 'Rick James'  
    newContactName: '',
    vTextSample: 'I dont use the mustache stuff just the v-text attribute.'
  // When your component is initialized and the rendered dom is 
  // put inside the component's element this function is 
  // run allowing you to run any functions from 
  // `methods` and access  `data`.
  ready: function() {
    // Load some content, run some initializing functions, or whatever.'This component is ready for use!')
  // All the methods you want the view 
  // to have access to, basically 
  // an object of functions.
  methods: {
    openAlert: function() {
    toggleExample: function() {
      this.showToggleExample = !this.showToggleExample
    createContact: function() {
      // Add the contact to our array accessed via `this`.
        name: this.newContactName
      // Clear the value of the variable attached to the input field.
      this.newContactName = ''