I am using Vue js and python flask as my backend. I want to have some local variable set. How can it be done?

后端 未结 2 466
别那么骄傲
别那么骄傲 2021-01-26 02:39

My Vue js file. Here I am using two urls from localhost. I want to make a configuration file such that if I make changes in config file, I will be able to get the same changes.<

2条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-26 03:08

    Since you use flask as a backend, you can just include config.js as a script before you include the vue scripts

    const URL = http://127.0.0.1:5000/
    

    Inside your vue files, you can then have access to the URL variable

提交回复
热议问题