Skip to content

Commit

Permalink
[#724][3.0] Tab 내부의 ctx 로직 삭제 (#854)
Browse files Browse the repository at this point in the history
################
- getCurrentInstance() 내 ctx 가져오는 로직을 지우고 mv의 값을 바로 provide로 넘김
  • Loading branch information
kdeun1 authored Aug 4, 2021
1 parent 6718ae3 commit 7311b1b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/components/tabPanel/TabPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default {
},
setup(props) {
const evTabs = inject('evTabs', null);
const mv = computed(() => evTabs.ctx.mv);
const mv = computed(() => evTabs);
const isSelected = computed(() => props.value === mv.value);
return {
Expand Down
7 changes: 3 additions & 4 deletions src/components/tabs/Tabs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
<script>
import {
ref, reactive, computed,
provide, getCurrentInstance, triggerRef,
provide, triggerRef,
onBeforeUpdate, nextTick, onUpdated,
} from 'vue';
Expand Down Expand Up @@ -131,16 +131,15 @@ export default {
change: [String, Number],
},
setup(props, { emit }) {
const instance = getCurrentInstance();
provide('evTabs', instance);
const mv = computed({
get: () => props.modelValue,
set: (val) => {
emit('update:modelValue', val);
emit('change', val);
},
});
provide('evTabs', mv.value);
const tabList = computed({
get: () => props.panels,
set: val => emit('update:panels', val),
Expand Down

0 comments on commit 7311b1b

Please sign in to comment.