Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- route
- Router
- 검색
- prisma
- angular route
- flex-1
- 모달
- 옵저버블
- 호버
- mysql if
- 아이오닉 스크롤 이벤트
- summary
- angular button
- angular animation
- 스크롤 이벤트
- formgroup
- egov spring ajax 사용 예시
- ApexChart
- angular modal
- 앵귤러 애니메이션
- Oracle LISTAGG 사용 예시
- scroll
- Ionic modal
- 셀렉트박스 커스텀
- 스크롤 이벤트 감지
- ajax 사용 예시
- 앵귤러 모달
- Angular Router
- TAILWIND
- modal
Archives
- Today
- Total
깜놀하는 해므찌로
vue.js 배열 핸들링 / vue.js for문 본문
반응형
SMALL
<template>
<div>
<h1>Home {{ title1 }}</h1>
</div>
<input type="text" v-model="input1"> <!-- 양방향 입력 가능-->
<button type="button" @click="getData">get</button> <!-- onclick 과 같은 효과 (vue.js)-->
<button type="button" @click="setData">set</button>
<select class="from-control" v-model="regions">
<option :key="i" v-for="(d, i) in options" :value="d.v"> <!-- :key : 고유한 이름 / data : d, i : index-->
<!-- : 콜론 사용 시 바로 데이터에 접근 가능-->
{{ d.t }}
</option>
</select>
<table>
<tr :key="i" v-for="(d,i) in options">
<td>{{ d.v }}</td> <!-- vlaue 값-->
<td>{{ d.t }}</td> <!-- text 값-->
</tr>
</table>
</template>
<script>
export default{
data(){
return{
title1 : "제목1",
title2 : "제목2",
input1 : "input1",
options : [
{
v : "S", t: "Seoul"
},
{
v : "J", t: "Jeju"
},
{
v : "B", t: "Busan"
}
],
regions : "B"
}
},
watch : { // 모니터링
input1(){
console.log(intpu1);
}
},
method : { // 자바스크립트의 모든 함수는 이곳에 선언
getDate(){
alert(this.input1);
},
setDate(){
this.input1 = "set";
},
},
}
</script>
반응형
LIST
'IT' 카테고리의 다른 글
@HostBinding 활용 예시 (0) | 2023.05.15 |
---|---|
Tailwind background image cover 배경 이미지 커버 활용 예시 / VW / VH (0) | 2023.05.15 |
vue.js selectbox 셀렉트 박스 예시 / v-for / v-model (0) | 2023.05.14 |
Springboot 스프링 부트 static / templates 폴더 (0) | 2023.05.13 |
Angular Ionic 스크롤 이벤트 감지 방법 간단 예시 (0) | 2023.05.13 |