首页 > 解决方案 > How to change the favicon dynamically in VueJs

问题描述

I would like to do this very common trick that is to be able to change the favicon of my VueJs app dynamically.

For example : I have a timer in my app that is running in background and I would like to change the favicon when the timer is running.

In VueJs since the favicon is set in the index.html file I really don't know how could I do to be able to modify it in others component of my app. ?

I tried this approach but it did not work

Thanks for your help

标签: vue.jsfavicon

解决方案


这会有所帮助,它是 Vue 2 和 3 的实用工具 库。VueUse useFavicon


推荐阅读