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.


                    <div id="app">
      <p>{{ time }}</p>
      <p>完整格式:{{ time | timeString }}</p>
      <p>年月日:{{ time | timeString('YYYY-MM-DD') }}</p>
      <p>時分秒:{{ time | timeString('HH:mm:ss') }}</p>
      <p>沒有指定:{{ time | timeString() }}</p>




                      // 定義過濾器
      Vue.filter('timeString', function(
        // 參數1=原本的格式 2= 希望的格式,如果沒第二個參數就會使用原本的
      ) {
        // format(ˋ如果有給值就用myFormat || 不然就用我們設定的'YYYY-MM-DD, HH:mm:ss')
        newValue = moment(value).format(myFormat || 'YYYY-MM-DD, HH:mm:ss');
        // 如何格式化,需找moment.js的用法
        return newValue;

      const vm = new Vue({
        el: '#app',
        data: {
          // 建構式取得現在時間
          time: new Date()
        methods: {}