<head>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>
<div id="app">
<input :type="type" :value="value">
<a :href="getUrl('search')">링크 이동</a>
</div>
<script>
new Vue({
el: '#app',
data: {
type: 'text',
value: 'Binding Text',
url: 'https://github.com/'
},
methods: {
getUrl(url) {
return this.url + url
}
}
})
</script>
'Framework > Vue2' 카테고리의 다른 글
[ Vue2 ] 05. Vue Computed 속성 (0) | 2024.11.08 |
---|---|
[ Vue2 ] 04. Vue 데이터 양방향 바인딩 (0) | 2024.11.08 |
[ Vue2 ] 03. Vue 이벤트 핸들링 (0) | 2024.11.06 |
[ Vue2 ] 01. Vue 함수 사용 (0) | 2024.11.06 |
[ Vue2 ] 00. Vue 인스턴스 생성 (0) | 2024.11.06 |