How to use the getCurrentInstance function from vue
Find comprehensive JavaScript vue.getCurrentInstance code examples handpicked from public code repositorys.
GitHub: LeFE-1/LeFE
42 43 44 45 46 47 48 49 50 51
setup(props) { const rootTabs = vue.inject('rootTabs'); if (!rootTabs) { throw new Error(`ElTabBar must use with ElTabs`); } const instance = vue.getCurrentInstance(); const getBarStyle = () => { let style = {}; let offset = 0; let tabSize = 0;
3
8
3
+ 3 other calls in file
GitHub: hacfins/vue3-multi-page
158 159 160 161 162 163 164 165 166 167
hitState: false, hover: false, }); const { currentLabel, itemSelected, isDisabled, select, hoverItem, } = useOption(props, states); const { visible, hover, } = vue.toRefs(states); const vm = vue.getCurrentInstance().proxy; select.onOptionCreate(vm); vue.onBeforeUnmount(() => { const { selected } = select; let selectedOptions = select.props.multiple ? selected : [selected];
1
2
1
+ 3 other calls in file
GitHub: hacfins/vue3-multi-page
27 28 29 30 31 32 33 34 35 36
setup(props) { const index = vue.ref(-1); const lineStyle = vue.ref({}); const internalStatus = vue.ref(''); const parent = vue.inject('ElSteps'); const currentInstance = vue.getCurrentInstance(); vue.onMounted(() => { vue.watch([() => parent.props.active, () => parent.props.processStatus, () => parent.props.finishStatus], ([active]) => { updateStatus(active); }, { immediate: true });
1
2
1
GitHub: hacfins/vue3-multi-page
147 148 149 150 151 152 153 154 155 156
const elForm = vue.inject(elFormKey, {}); const validateState = vue.ref(''); const validateMessage = vue.ref(''); const validateDisabled = vue.ref(false); const computedLabelWidth = vue.ref(''); const vm = vue.getCurrentInstance(); const isNested = vue.computed(() => { let parent = vm.parent; while (parent && parent.type.name !== 'ElForm') { if (parent.type.name === 'ElFormItem') {
1
2
1
115 116 117 118 119 120 121 122 123 124
message: {} }); const route = vueRouter.useRoute(); const { appContext } = vue.getCurrentInstance(); const breadcrumbRoutes = vue.computed(() => { return breadcrumb.value || route.meta.breadcrumb || route.matched.slice(1).map(_route => { return { path: _route.path,
1
1
4
21 22 23 24 25 26 27 28 29 30 31 32
function useRouter () { if (process.env.NODE_ENV !== 'production') { throwNoCurrentInstance('useRouter') } return vue.getCurrentInstance().proxy.$root.$router } function useRoute () { if (process.env.NODE_ENV !== 'production') {
0
0
1
+ 14 other calls in file
726 727 728 729 730 731 732 733 734 735 736
} } function getCurrentManager(vm) { if (!vm) { vm = vue.getCurrentInstance() || undefined; } if (!vm) { return undefined; }
0
0
1
+ 15 other calls in file
vue.createElementBlock is the most popular function in vue (2388 examples)