In a vue.js component I'm trying to compile a variable in a template but its not getting compiled/converted. Any advice how I can achieve the following:
<template>
<img src="{{ window.SETTINGS.ASSETS_DIR + 'img/foo.jpg' }}"/>
</template>
Where settings is:
window.SETTINGS = {
ASSETS_PATH: '/wp-content/themes/my-theme/assets/',
API_BASE_PATH: '/wp-json/wp/v2/'
}
<img v-bind:src="window.SETTINGS.ASSETS_DIR + 'img/foo.jpg'"/>use v-bind for attributeswindows.SETTINGSobject doesn't contain a variable calledASSETS_DIR.