Pen Settings

HTML

CSS

CSS Base

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

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.

Vue

              
                <template>
  <div id="app">
    <h1>{{count }}</h1>
    <h1>콘솔값 확인!</h1>
  </div>
</template>

<script>
export default {
  data(){
    return{
      count : 2
    }
  },
  // beforeCreate : 컴포넌트가 생성되기 전에 실행됨 (데이터가 정의되지 않음)
  beforeCreate(){
    console.log('beforeCreate! : ', this.count); // undefined
  },
  // created
  // 컴포넌트가 생성된 직후에 실행됨
  // HTML 못찾음
  // 활용도 많음!
  created(){
    console.log('Created! : ', this.count); // 2
    console.log(document.querySelector('h1')); // null
  },
  // beforeMount : 화면이 출력 되기전에 실행됨
  beforeMount(){
    console.log('beforeMount!');
    console.log(document.querySelector('h1')); // null
  },
  // mounted : 화면에 출력이 되고나서 실행됨(화면에 그려진 내용 조회할때 사용)
  // 활용도 많음!
  mounted(){
    console.log('mounted!');
    console.log(document.querySelector('h1')); // h1태그 찾음
  }
}
</script>
              
            
!
999px

Console