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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource


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


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.


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">
  <!-- 유니크 키가 없는 배열 -->
    <option v-for="item in list">{{ item }}</option>
  <!-- 리터럴에 직접 v-for 적용 -->
  <p v-for="item in 3">{{ item }} 번째 P </p>
  <!-- 리터럴에 직접 & 배열사용 -->
  <p v-for="item in [1, 5, 10]">{{ item }}</p>
  <!-- 문자열에 v-for 적용-->
  <p v-for="item in text">{{ item }}</p>
  <!-- key는 반복 렌더링에서도 유니크한 key속성을 부여하는것이 권장된다 -->
    <li v-for="(mob, idx) in monster" v-bind:key="">
      [ id : {{}} ] [ name: {{}} ]  [ HP: {{mob.hp}} ]
      <strong v-if="mob.hp > 300"> 강하다!</strong>
      <button v-on:click="mobAttack(idx)">attack</button>
      <button v-on:click="mobDelete(idx)" v-bind:class="{'del':true}">delete</button>
    <div>몹 추가</div>
    이름 : <input type="text" v-model="addMonsterName">
    HP : <input type="text" v-model="addMonsterHp">
    <button v-on:click="mobAdd">add</button>



  color: red;
  margin-left: 20px;


                const data = {
  list : ['리스트1', '리스트2', '리스트3'],
  text : 'TEST',
  monster : [
    { id: 1, name: '슬라임', hp: 100 },
    { id: 2, name: '고블린', hp: 200 },
    { id: 3, name: '드래곤', hp: 500 }
  addMonsterName : '',
  addMonsterHp : 0

const app = new Vue({
  el : '#app',
  data : data,
  methods : {
    mobAdd : function(){
      //리스트 내부에서 가장 큰 id값 추출
      const max =,b){
         return a > ? a :;
      }, 0);{
        id: max + 1,
        name : this.addMonsterName,
        hp : this.addMonsterHp
    mobDelete : function(idx){
      //배열의 splice 메서드로 제거, 1);
    mobAttack : function(idx){[idx].hp -= 10; // HP 10 감소