# Warning \[Vue warn\]: Avoid app logic that relies on enumerating keys on a component instance

**URL:** <https://forum.ionicframework.com/t/warning-vue-warn-avoid-app-logic-that-relies-on-enumerating-keys-on-a-component-instance/210220>\
**Category:** Ionic Vue\
**Created:** [May 28, 2021, 3:53am UTC](https://forum.ionicframework.com/t/warning-vue-warn-avoid-app-logic-that-relies-on-enumerating-keys-on-a-component-instance/210220 "2021-05-28T03:53:16Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![donpuerto](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/donpuerto/32/134002_2.png) [@donpuerto](https://forum.ionicframework.com/u/donpuerto)\
**Post date:** [May 28, 2021, 3:53am UTC](https://forum.ionicframework.com/t/warning-vue-warn-avoid-app-logic-that-relies-on-enumerating-keys-on-a-component-instance/210220/1 "2021-05-28T03:53:16Z")

</div>

![image](https://global.discourse-cdn.com/ionicframework/original/3X/e/e/ee3ed76fd51e1ce9b56812202e01f1609818699b.png)  
**Expected behavior:**  
Routing causes vue warning on the console. Don’t how to troubleshoot the problem. Code is working but got a warning

**Related code:**  
When routing is click, vue warning error occured.

```auto
<core-footer 
      message="Already got an account?" 
      text="Login" 
      link="/auth/login"
    />

```

```auto
<ion-row class="ion-text-center ion-justify-content-center">
    <ion-col size="12">
            <p >{{$props.message}} 
                        <span @click="() => router.push($props.link)" class="custom-link">{{text}} &rarr;</span>
            </p>
                
    <ion-col>
</ion-row>

```

---

<div class="post-metadata">

**Author:** ![whitersun](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/whitersun/32/138029_2.png) [@whitersun](https://forum.ionicframework.com/u/whitersun)\
**Post date:** [May 28, 2021, 6:30am UTC](https://forum.ionicframework.com/t/warning-vue-warn-avoid-app-logic-that-relies-on-enumerating-keys-on-a-component-instance/210220/2 "2021-05-28T06:30:00Z")

</div>

Could you show me the entire component of the core-footer pls?

Did you bind some props on the core footer?

---

<div class="post-metadata">

**Author:** ![donpuerto](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/donpuerto/32/134002_2.png) [@donpuerto](https://forum.ionicframework.com/u/donpuerto)\
**Post date:** [May 28, 2021, 7:13am UTC](https://forum.ionicframework.com/t/warning-vue-warn-avoid-app-logic-that-relies-on-enumerating-keys-on-a-component-instance/210220/3 "2021-05-28T07:13:51Z")

</div>

@whitersun Here it is

```auto
<template>
    <ion-footer>
        <ion-grid>
           
            <ion-row class="ion-text-center ion-justify-content-center">
                <ion-col size="12">
                    <p >{{$props.message}} 
                        <span @click="() => router.push($props.link)" class="custom-link">{{text}} &rarr;</span>
                    </p>
                </ion-col>
                <ion-col>
                    
                </ion-col>
            </ion-row>
        </ion-grid>
         <svg style="margin-bottom:-0.5rem" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="#7a506f" fill-opacity="1" d="M0,288L40,277.3C80,267,160,245,240,224C320,203,400,181,480,176C560,171,640,181,720,181.3C800,181,880,171,960,144C1040,117,1120,75,1200,58.7C1280,43,1360,53,1400,58.7L1440,64L1440,320L1400,320C1360,320,1280,320,1200,320C1120,320,1040,320,960,320C880,320,800,320,720,320C640,320,560,320,480,320C400,320,320,320,240,320C160,320,80,320,40,320L0,320Z"></path></svg>
    
    </ion-footer>
   
</template>

<script lang='ts'>
import { defineComponent, onMounted } from 'vue'
import {  
    IonFooter,
    IonGrid, IonCol, IonRow, 
} from '@ionic/vue';
import { useRouter } from 'vue-router';
export default defineComponent({
    components: {
        IonFooter, 
        IonGrid, IonCol, IonRow, 

    },
    props: {
        message: {
            type: String,
            required: true
        },
        text: {
            type: String,
            required: true
        },

        link: {
            type: String,
            required: true
        },

    },
    setup () {
        const router = useRouter();
        onMounted(()=> {
            console.log('Footer Component')
        })

        
        return { router };
    }
})
</script>

<style scoped lang="scss">
ion-footer {
    ion-toolbar {
        --background: #7c3b6a;
        color: white;
        text-align: center;
    }
}
</style>

```

---

<div class="post-metadata">

**Author:** ![whitersun](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/whitersun/32/138029_2.png) [@whitersun](https://forum.ionicframework.com/u/whitersun)\
**Post date:** [May 28, 2021, 7:31am UTC](https://forum.ionicframework.com/t/warning-vue-warn-avoid-app-logic-that-relies-on-enumerating-keys-on-a-component-instance/210220/4 "2021-05-28T07:31:04Z")

</div>

Hi, try using like this:

```auto
props: ['message', 'text', 'link']

```

Of course, u also able to use like this if have some case we must do:

```auto
    props: {
        message: {
            type: String,
            required: true
        },
        text: {
            type: String,
            required: true
        },

        link: {
            type: String,
            required: true
        },

    },

```

and when u bind props, try to remove dollar site ( “$” ) and props, just like this: {{ message }} or maybe {{ link }}  
The reason is you are using props inside a component not outside or bind something and ionic combine FW is vue 3 not vue 2 :))

outside component or in father Component bind the element like you key on core-footer component

---

<div class="post-metadata">

**Author:** ![donpuerto](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/donpuerto/32/134002_2.png) [@donpuerto](https://forum.ionicframework.com/u/donpuerto)\
**Post date:** [May 28, 2021, 2:38pm UTC](https://forum.ionicframework.com/t/warning-vue-warn-avoid-app-logic-that-relies-on-enumerating-keys-on-a-component-instance/210220/5 "2021-05-28T14:38:53Z")

</div>

Thanks, I tried but it’s not working on the above suggestion

---

<div class="post-metadata">

**Author:** ![whitersun](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/whitersun/32/138029_2.png) [@whitersun](https://forum.ionicframework.com/u/whitersun)\
**Post date:** [May 31, 2021, 5:26am UTC](https://forum.ionicframework.com/t/warning-vue-warn-avoid-app-logic-that-relies-on-enumerating-keys-on-a-component-instance/210220/6 "2021-05-31T05:26:11Z")

</div>

That is work for me, Could you check again on you component where bind the props place, that shouldn’t have $props.

It should be like that {{ message }}, {{ link }}. Not like this {{ $props.message }}, {{ $props.link }}

and in you component name bind in Father Component should be like this:  
`<core-footer :message="Hello world" :link="/path" />`

---

<div class="post-metadata">

**Author:** ![donpuerto](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/donpuerto/32/134002_2.png) [@donpuerto](https://forum.ionicframework.com/u/donpuerto)\
**Post date:** [May 31, 2021, 6:21am UTC](https://forum.ionicframework.com/t/warning-vue-warn-avoid-app-logic-that-relies-on-enumerating-keys-on-a-component-instance/210220/7 "2021-05-31T06:21:02Z")

</div>

Yes code works but error still exists ☹

---

<div class="post-metadata">

**Author:** ![whitersun](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/whitersun/32/138029_2.png) [@whitersun](https://forum.ionicframework.com/u/whitersun)\
**Post date:** [May 31, 2021, 6:22am UTC](https://forum.ionicframework.com/t/warning-vue-warn-avoid-app-logic-that-relies-on-enumerating-keys-on-a-component-instance/210220/8 "2021-05-31T06:22:34Z")

</div>

could u show the errors and entire core-footer component and father component? or may you have github?

---

<div class="post-metadata">

**Author:** ![whitersun](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/whitersun/32/138029_2.png) [@whitersun](https://forum.ionicframework.com/u/whitersun)\
**Post date:** [May 31, 2021, 6:23am UTC](https://forum.ionicframework.com/t/warning-vue-warn-avoid-app-logic-that-relies-on-enumerating-keys-on-a-component-instance/210220/9 "2021-05-31T06:23:37Z")

</div>

Maybe in you core-footer component have some stuck I dont know why did you key for, that may make you component be complex and stuck together…

---

<div class="post-metadata">

**Author:** ![donpuerto](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/donpuerto/32/134002_2.png) [@donpuerto](https://forum.ionicframework.com/u/donpuerto)\
**Post date:** [May 31, 2021, 12:25pm UTC](https://forum.ionicframework.com/t/warning-vue-warn-avoid-app-logic-that-relies-on-enumerating-keys-on-a-component-instance/210220/10 "2021-05-31T12:25:47Z")

</div>

@whitersun here it is mate. Thanks  
[donPuerto/ionicvueV5-login-register-form-validation-appv1 (github.com)](https://github.com/donPuerto/ionicvueV5-login-register-form-validation-appv1)

---

<div class="post-metadata">

**Author:** ![codeluggage](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/codeluggage/32/137576_2.png) [@codeluggage](https://forum.ionicframework.com/u/codeluggage)\
**Post date:** [June 1, 2021, 9:30am UTC](https://forum.ionicframework.com/t/warning-vue-warn-avoid-app-logic-that-relies-on-enumerating-keys-on-a-component-instance/210220/11 "2021-06-01T09:30:25Z")

</div>

Chiming in quickly here to add my experience. I had a very difficult time tracking down exactly why this was happening in my app, as it didn’t print any error that I could trace back to actual events in the HTML.

I used Vuex `useStore()` from a plain Typescript file, imported into a Vue component. I didn’t remember reading that `useStore()` could only be called from inside of `setup()` in a Vue component.

---

<div class="post-metadata">

**Author:** ![whitersun](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/whitersun/32/138029_2.png) [@whitersun](https://forum.ionicframework.com/u/whitersun)\
**Post date:** [June 5, 2021, 7:23pm UTC](https://forum.ionicframework.com/t/warning-vue-warn-avoid-app-logic-that-relies-on-enumerating-keys-on-a-component-instance/210220/12 "2021-06-05T19:23:52Z")

</div>

Hi @donpuerto, I don’t see where your component has a named core-footer in Github. Do you make sure you push it up to GitHub?

---

<div class="post-metadata">

**Author:** ![donpuerto](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/donpuerto/32/134002_2.png) [@donpuerto](https://forum.ionicframework.com/u/donpuerto)\
**Post date:** [June 6, 2021, 6:34am UTC](https://forum.ionicframework.com/t/warning-vue-warn-avoid-app-logic-that-relies-on-enumerating-keys-on-a-component-instance/210220/13 "2021-06-06T06:34:07Z")

</div>

@whitersun The repo is reuploaded to Github.

Thanks for checking.

---

<div class="post-metadata">

**Author:** ![whitersun](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/whitersun/32/138029_2.png) [@whitersun](https://forum.ionicframework.com/u/whitersun)\
**Post date:** [June 6, 2021, 6:48am UTC](https://forum.ionicframework.com/t/warning-vue-warn-avoid-app-logic-that-relies-on-enumerating-keys-on-a-component-instance/210220/14 "2021-06-06T06:48:00Z")

</div>

You close… did you set your Github private?

 ![image](https://global.discourse-cdn.com/ionicframework/original/3X/d/a/da5d5c692c65171bb18b68120758b95e2815d24e.jpeg)

---

<div class="post-metadata">

**Author:** ![donpuerto](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/donpuerto/32/134002_2.png) [@donpuerto](https://forum.ionicframework.com/u/donpuerto)\
**Post date:** [June 6, 2021, 8:26am UTC](https://forum.ionicframework.com/t/warning-vue-warn-avoid-app-logic-that-relies-on-enumerating-keys-on-a-component-instance/210220/15 "2021-06-06T08:26:43Z")

</div>

Opps, @whitersun sorry mate

---

<div class="post-metadata">

**Author:** ![whitersun](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/whitersun/32/138029_2.png) [@whitersun](https://forum.ionicframework.com/u/whitersun)\
**Post date:** [June 6, 2021, 11:26am UTC](https://forum.ionicframework.com/t/warning-vue-warn-avoid-app-logic-that-relies-on-enumerating-keys-on-a-component-instance/210220/16 "2021-06-06T11:26:50Z")

</div>

I saw your project on Footer.vue bind to Home.vue is work totally fine. In your home project is already shows up which has your text in that component. Compile and check on the browser is totally ok.

So I think before You upload GitHub here, You already solved the problem…
