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 |
29 | 30 | 31 |
Tags
- Kotlin
- tomcat
- mapreduce
- MSSQL
- es6
- IntelliJ
- Java
- window
- Python
- plugin
- 공정능력
- Spring
- SPC
- NPM
- hadoop
- xPlatform
- SQL
- R
- Eclipse
- JavaScript
- Android
- 보조정렬
- GIT
- vaadin
- Sqoop
- mybatis
- SSL
- Express
- table
- react
Archives
- Today
- Total
DBILITY
vue 실습 01 본문
반응형
dataset을 binding하고, 버튼을 눌렀을때, 가격을 반으로 처리해 보았다. 이게 맞는지는 모르겠다.
<template>
<img alt="Vue logo" src="./assets/logo.png">
<div v-for="(estate,index) in estateList" :key="index">
<h4>{{estate.name}}</h4>
<p>{{new Intl.NumberFormat('ko-KR',{style:'currency', currency:'KRW'}).format(estate.price)}}원</p>
</div>
<button @click="discount">반값할인</button>
</template>
<script>
export default {
name: 'App',
data() {
return {
estateList: [
{name: '우리집', price: 50000000},
{name: '너네집', price: 1500000000}
]
}
},
methods : {
discount(){
this.estateList.forEach(function(value, index, array){
console.log(value,index,array);
array[index].price = value.price/2;
});
}
},
components: {}
}
</script>
<style>
#app {
font-family: Avenir, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
margin-top: 60px;
}
</style>
반응형
'front-end & ui > vuejs' 카테고리의 다른 글
vuejs BASE_URL relative path build (0) | 2021.10.26 |
---|---|
vue 3 image src binding (0) | 2021.08.06 |
vue 3 vue-router,plugin 설치 및 project 적용 (0) | 2021.08.04 |
vue 3 version project create (0) | 2021.07.30 |
vue 3 instance lifecycle (0) | 2020.11.28 |
Comments