Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

187
Views
(Vue3)When I make a change in the static js file, it is not reflected on the screen

I created an empty vue3 project. And I created global.js to the public file.

global.js;

window.testPrint = "test message";
export default {}

vue.config.js;

// vue.config.js
/**
 * @type {import('@vue/cli-service').ProjectOptions}
 */


module.exports = {
    publicPath: "./"
};

App.vue;

<template>
    <p>
        {{getTest()}}
    </p>
  <div id="nav">
    <router-link to="/">Home</router-link> |
    <router-link to="/about">About</router-link>
  </div>
  <router-view />
</template>

<script>
    export default {
        methods: {
            getTest() {
                return window.testPrint;
            }
        }
    }
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
}

#nav {
  padding: 30px;
}

#nav a {
  font-weight: bold;
  color: #2c3e50;
}

#nav a.router-link-exact-active {
  color: #42b983;
}
</style>

main.js;

import { createApp } from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";

createApp(App).use(store).use(router).mount("#app");


import "../public/global.js";

On the screen output that I have built and run on iis, window.testPrint = "test message"; shaped. When I change this value in global.js and do Ctrl+F5, the screen does not change and still remains as "test message".

enter image description here

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!