diff --git a/index.html b/index.html index 003025d..884b255 100644 --- a/index.html +++ b/index.html @@ -188,8 +188,8 @@ }, }).$mount('#app'); - areas = vm.$refs.areas; - areas.getComponentByName("comp1").cfg.props.text = "Youhou ! =D"; // This is reactive ! + // areas = vm.$refs.areas; + // areas.getAreaContentByName("comp1").cfg.props.text = "Youhou ! =D"; // This is reactive ! diff --git a/src/Areas.vue b/src/Areas.vue index 734d750..64d9418 100644 --- a/src/Areas.vue +++ b/src/Areas.vue @@ -222,7 +222,7 @@ export default { this.$nextTick(this.reattachTeleports); }, - getComponentByName(name) { + getAreaContentByName(name) { return this.areasContent .filter(Boolean) .filter(areaContent => areaContent.name) diff --git a/unitTest/test.js b/unitTest/test.js index a93d040..9356f1e 100644 --- a/unitTest/test.js +++ b/unitTest/test.js @@ -166,7 +166,7 @@ describe('Areas', () => { }, ], layout: { - name: 'targetComponent', + name: 'targetArea', componentIndex: 0, cfg: { props: { @@ -179,7 +179,7 @@ describe('Areas', () => { const wrapper = shallowMount(Areas, { propsData: { cfg } }); expect(wrapper.html()).toMatchSnapshot(); - wrapper.vm.getComponentByName("targetComponent").cfg.props.text = "text updated"; + wrapper.vm.getAreaContentByName("targetArea").cfg.props.text = "text updated"; await Vue.nextTick(); expect(wrapper.html()).toMatchSnapshot(); });