๐ก Vue.js Instance Properties & Reactivity โ Executive Summary
Technical architectural analysis, practical configuration manifests, and deployment instructions for Vue.js Instance Properties & Reactivity.
์ ์ญ ๋ณ์
\$parent
- ๋ถ๋ชจ ์ปดํฌ๋ํธ
\$refs[โrefernameโ]
- ์ ์ธ๋ child ์ปดํฌ๋ํธ map Object
- ๋ถ๋ชจ์ปดํฌ๋ํธ ๋ด์ ์ ์ธ
- \
์ ์ญ ๋ฉ์๋
\$set(obj, index or key, value)
sql
## ๋ณ๊ฒฝ๊ฐ์ง ํ์ฑํ
### ์ค๋ธ์ ํธ
var vm = new Vue({
data: {
someObject: {
a: 1
}
}
});
// `vm.someObject.a` ๋ ์ด์ ๋ฐ์ํ์
๋๋ค.
vm.someObject.b = 2;
// `vm.someObject.b` ๋ ๋ฐ์ํ์ด ์๋๋๋ค.
// ์๋์ ๋ฐฉ์์ผ๋ก ๋ฐ์ํ์ผ๋ก ์ด๊ธฐํ ๊ฐ๋ฅ
Vue.set(vm.someObject, 'b', 2);
vm.$set(vm.someObject, 'b', 2);
this.$set(vm.someObject, 'b', 2);
### ๋ฐฐ์ด
var vm = new Vue({
data: {
items: ['a', 'b', 'c']
}
});
vm.items[1] = 'x'; // ๋ฐ์ํ์ด ์๋๋๋ค
vm.items.length = 2; // ๋ฐ์ํ์ด ์๋๋๋ค
// ์๋์ ๋ฐฉ์์ผ๋ก ๋ฐ์ํ์ผ๋ก ์ด๊ธฐํ ๊ฐ๋ฅ
Vue.set(vm.items, indexOfItem, newValue);
vm.$set(vm.items, indexOfItem, newValue);
this.$set(this.items, indexOfItem, newValue);




Leave a Reply