I need to use vue js variables inside the index.html page.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<link rel="shortcut icon" :href="$store.state.siteLogo" type="image/x-icon" />
<link rel="stylesheet" type="text/css" href="static/layui/css/layui.css" />
<link rel="stylesheet" type="text/css" href="static/layui/common.css" />
<title id="siteTitle">{{$store.state.siteTitle}}</title>
</head>
<body>
<div id="app"></div>
</body>
</html>
There, for the title, I need to get a value from the service. That value was able to get from a service and assigned it to a store js variable. My attempt is as in above and it's not working since it's an html file. Anyone, knows how can I achieve this? It worked like this. Inside App.vue created method if we set document.title as below.
created() {
document.title = this.$store.state.siteTitle;
}
But now I need to know how can I change the shortcut icon as well from the service. Does anyone know?