Pen Settings

HTML

CSS

CSS Base

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

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.

Vue

              
                <template>
  <div id="app">
    <h1>입력할때 마다 값 변경하기</h1>
    <h1>msg : {{msg}}</h1>
    <!-- @input : 입력이 될때 발동함 -->
    <input 
      type="text" 
      :value="msg"
      @input="handler">
    <!-- 한글 사용할떄는 이거로 사용하기 -->
    <input 
      type="text" 
      :value="msg"
      @input="msg = $event.target.value"
      placeholder="한글을 사용할떄는 이 코드를 사용하세요">
    <!-- 위에 코드 더 간략하게 하기 -->
    <input type="text" v-model="msg">
    <br>
    <br>
    <h1>체크 할때마다 T/F 변경하기</h1>
    <h1>flag : {{flag}}</h1>
    <input 
      type="text" 
      v-model="msg">
    <!--  -->
    <input 
      type="checkbox"
      v-model="flag">
  </div>
</template>

<script>
export default {
  data(){
    return{
      msg:'Hello',
      flag:false
    }
  },
  methods:{
    handler(event){
      console.log(event.target.value) // 입력할때마 value값 반환
      this.msg = event.target.value // 입력할때마다 msg값 변경됨
    }
  }
}
</script>

              
            
!
999px

Console