0 votes
in VueJS by
How can I use imported constant in template section?

1 Answer

0 votes
by

The variables need to be exposed on your data in order to use them in template section. i.e, You can't use them directly on template.

<span>
   CREATE: {{CREATE_PROP}}
   UPDATE: {{UPDATE_PROP}}
   DELETE: {{DELETE_PROP}}
</span>
<script>
import {CREATE_DATA, UPDATE_DATA, DELETE_DATA} from 'constants';
new Vue({
    ...
    data:{
        CREATE_PROP: CREATE_DATA,
        UPDATE_PROP: UPDATE_DATA,
        DELETE_PROP: DELETE_DATA
    }
    ...
})
</script>

Related questions

0 votes
asked Sep 9, 2023 in VueJS by AdilsonLima
0 votes
asked Sep 15, 2023 in VueJS by JackTerrance
...