Find answers, ask questions, and connect with our
community around the world.

Forums Forums Web Design Multi-part question using vue for single page application and state management

  • Multi-part question using vue for single page application and state management

    updated 1 year, 3 months ago 0 Member · 1 Post
  • BusinessMag

    Member
    July 4, 2021 at 9:28 am

    I am new to the web dev world and am trying to have a response from an api replace an image in html using javascript. Currently, I have the html just as index.html and when I open in browser its just c:pathtofile. The javascript part I make a request to an api which in turn returns a response that contains a directive to replace a div class id with the img tag. I then take the response and send it in another api call that is supposed to automatically update the html without me having to do anything. The issue is that its not updating at all. I then tried to setup a vue server by installing vue and yarn and ran “vue-cli-service serve” so now I have my html running as localhost. Is this the right path to get the automatic update? or should it also work just using the html flat file? 2.After setting this up, I can update the html dynamically, but my javascript file hasnt been updating (i.e. trying to add a console.log and looking at sources in dev tools show no changes to javascript file). Do I have to wrap the api calls in a created(){[…]} and a mounted(){[…}? I have been trying things intensively and am at the moment spinning my wheels. I am just looking for direction to get me down the right path. The javascript code is very simple just a //returns the directive, id, img tag, etc api.sendaction(path,{key = id}) //supposed to auto add response to html .then((response) =>{ api.process(response)}); – by /hq/DirtyMudder92 – –

Viewing 1 of 1 replies
Reply to: BusinessMag
Your information:

Cancel
Original Post
0 of 0 posts June 2018
Now