Value passing problem of vue component

  1. question

the parent component defines a variable value through Vuex, and the child component uses this variable to decide which component to load.

import store from "../stores"
const tab01=store.state.tab;
console.log("tab01name",store.state.tab);

var tab2 = require(`./${tab01}.vue`)

tab01 value is underfined

Mar.07,2021

in this case, you should use ide/components-dynamic-async.html" rel=" nofollow noreferrer "> dynamic components


Vuex to get the value, const tab01= this.$store.getters.getTab, and agree to the upstairs method

.
Menu