Pen Settings

HTML

CSS

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

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

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.

HTML

              
                <div id="app">
  <ul class='region-list'>
    <li v-for="(list, area) in libraries">
      <h2>{{area}}</h2>
      <ul>
        <li class='library-item' v-for="library in list">
          {{library.name}}
          <div class="open-hour">{{library.open_hour}}</div>
        </li>
      </ul>
    </li>
  </ul>
</div>
              
            
!

CSS

              
                html, body {
  background: snow;
}
ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.region-list h2 {
  font-size: 1em;
  font-weight: normal;
  padding: 0.5em;
  margin: 0;
  background: rgba(200,200,200,0.9);
  color: #222;
  
  position: -webkit-sticky;
  position: sticky;
  
  top: 0;
  
}
.library-item {  
  padding: 1em 0.5em;
  background: snow;
  border-bottom: 1px solid #ccc;
}
.open-hour {
  color: grey;
  font-size: .6em;
  padding-top: .8em;
}
              
            
!

JS

              
                var app = new Vue({
  el: "#app",
  data: {
    name: "Thomas",
    libraries: {
      澳門中區: [
        { name: "澳門中央圖書館", open_hour: "星期一至日 10:00 – 20:00" },
        { name: "何賢公園圖書館", open_hour: "星期二至星期日 8:00 - 20:00" }
      ],
      澳門南區: [
        { name: "何東圖書館", open_hour: "星期一至六 10:00 – 19:00 星期日 11:00 – 19:00" },
        { name: "下環圖書館", open_hour: "星期二至星期日 8:00 - 20:00" }
      ],
      澳門西區: [
        {
          name: "沙梨頭圖書館",
          open_hour: "星期一 14:00 - 20:30 星期二至星期日 09:30 - 20:30"
        },
        { name: "紅街市圖書館", open_hour: "星期一至日 全日開放" },
        { name: "白鴿巢公園黃營均圖書館", open_hour: "星期二至星期日 8:00 - 20:00" }
      ],
      澳門北區: [
        { name: "青洲圖書館", open_hour: "星期一至六 10:00 – 20:00 星期日 12:00 – 20:00" },
        { name: "望廈圖書館", open_hour: "星期一至日 12:00 – 19:00" },
        { name: "紀念孫中山公園黃營均圖書館", open_hour: "星期二至星期日 8:00 - 20:00" },
        { name: "黑沙環公園黃營均圖書館", open_hour: "星期二至星期日 8:00 - 20:00" },
        { name: "黑沙環公園黃營均兒童圖書館", open_hour: "星期二至星期日 8:00 - 20:00" }
      ],
      氹仔: [
        { name: "氹仔圖書館", open_hour: "星期一14:00 - 20:30 星期二至星期日9:30 – 20:30" },
        { name: "氹仔黃營均圖書館", open_hour: "星期二至星期日 8:00 - 20:00" }
      ],
      路環: [{ name: "路環圖書館", open_hour: "星期一至六 13:00 – 19:00" }],
      其他: [
        { name: "流動圖書館", open_hour: "星期一、二及五 12:00 - 19:00 星期三 12:30 - 18:30" },
        { name: "民政總署大樓圖書館", open_hour: "星期一至六 13:00 – 19:00" }
      ]
    }
  }
});


document.ontouchstart = function(){};
              
            
!
999px

Console

Open Chat