Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
131 views
in Technique[技术] by (71.8m points)

javascript - 如何在vue中使用生成的HTML?(How to use generated HTML in vue?)

Why is it that when I copy the HTML generated by vue in inspect element all @click event is gone ?(为什么当我在检查元素中复制vue生成的HTML时,所有@click事件都消失了?)

Does anyone have idea how vue works ?(有谁知道vue是如何工作的?)   ask by stranger_cool translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Your question is not really clear... But what I can say is that Vue.js use something call virtual DOM.(您的问题尚不清楚...但是我能说的是Vue.js使用了一种称为虚拟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(您可以阅读本文以获取更多详细信息: https : //medium.com/js-dojo/whats-the-deal-with-vue-s-virtual-dom-3ed4fc0dbb20)

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...