Created
November 28, 2019 09:29
-
-
Save ksy90101/a040bc53c6759866c7e22095ab30c10b to your computer and use it in GitHub Desktop.
[Groom] Vue.js로 시작하는 SPA 개발 Chapter05 - Ex4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="ko"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>[Groom]Vue.js로 시작하는 SPA개발 - Chapter05 - Ex4</title> | |
<!-- Vue.js 추가 --> | |
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script> | |
</head> | |
<body> | |
<div id ="app"> | |
<p v-on:copy.prevent="isCopied">중요한 정보(복사 X)</p> | |
<!-- v-on:copy.prevent : copy의 이벤트를 막으라는 의미(즉, 복사가 안되게 설정) --> | |
</div> | |
<script> | |
let vm = new Vue({ // Vue 생성 | |
el:"#app", // app이라는 id를 가지고 있는 element 선택 | |
methods: { // 메소드 선언 | |
isCopied(){ // 복사하려고 하면 alert창 뜨게 함. | |
alert("저작권법 위반입니다."); | |
} | |
}, | |
}) | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment