Skip to content

USe data from another object VueJs

i have quick question here.

I have my object with value:

  data() {
    return {
      nation: {
        CZ: require("../../../../../svg/czech-flag.svg"),

Then have API object (API is working fine, fyi)

  doctor: {
    region: "CZ"

I wanna do something like this (is not working of course):

<div v-html="></div>

I had method for this, it worked, but I think it can be easier to do that. Thanks a lot for any help


You can use something like nations[`${doctor.region}`]

Working code:

const data = {
    nations: {
        CZ: 'Czech'
const doctor = {
    region: 'CZ'