Vue設定グローバル変数


global.jsを新規作成します。
const sourceIp =  'http://120.24.99.100:91'
export default{
    sourceIp
}
main.jsに導入してマウントします。
//        
import global from './api/Global.js'
Vue.prototype.global = global
使用するページ
{{sourceIp}}//    
img class="ev_img"  v-if="currentTab === 0" :src="sourceIp+this.imgbar[0]" alt />



data() {
    return {
        sourceIp:this.global.sourceIp,
        }
      }