1

Why is it that when I copy the HTML generated by vue in inspect element all @click event is gone ?

Does anyone have idea how vue works ?

2
  • I already put the build.js in html file. Commented Nov 29, 2019 at 9:16
  • 2
    Why java and spring-boot tags? Commented Nov 29, 2019 at 9:19

1 Answer 1

3

Your question is not really clear... But what I can say is that Vue.js use something call virtual DOM. So what you code is not what is showed in the browser.

You can read this article for more details : https://medium.com/js-dojo/whats-the-deal-with-vue-s-virtual-dom-3ed4fc0dbb20

Sign up to request clarification or add additional context in comments.

5 Comments

Yeah I think your answer is correct , do you have any idea on how I can make this work ? Right now we are trying to render page using the html that is generated by the vue. How can I get the event ?
In Vue , event are calling methods. So you have to bind an events to one of your html elements, and define a method. This link will give you all the details : vuejs.org/v2/guide/events.html
actually, the case is I want to use a build.js file generated by webpack as a normal js file in an html page, is this even possible?
Yes it is the way it work. With vue js you create you app by creating multiple components, including modules etc... and then webpack will build your app and put everything in a single .js file. So all you have to do is to add this single .js into your html.
I have an existing system that is created in vue. What I want to achieve is from that I will copy the html by inspect element and put the html in another system also the build.js is this even possible to work ? The html and css is now working well , but when I click the button that supposed to be have events are now not working anymore.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.