Vite부터 시작하는 Vue 3 생활 by 백진후 about Vue
- < template > < p > count: {{ count }} p > < button @click = " count++ " > count update button > < p > list: {{ list }} p > < button @click = " updateList(list) " > list push button > < p > readOnlyCount: {{ readOnlyCount }} p > < button @click = " readOnlyCount++ " > readOnlyCount update button > < hr /> < p > failedCount: {{ failedCount }} p > < button @click = " failedCount++ " > count update button > < p > failedList: {{ failedList }} p > < button @click = " updateList(failedList) " > list push button > template > < script > import { ref
- readonly } from 'vue' export default { setup ( ) { const count = ref ( 0 ) const list = reactive ( [ ] ) const readOnlyCount = readonly ( count ) const failedCount = reactive ( 0 ) const failedList = ref ( [ ] ) const updateList = ( base ) => { base
- < template > < h1 > 출입문 h1 > < p > {{ welcomeMessage }} p > < button @click = " leave " > 떠나기 button > template > < script > import { reactive