Home > front end >  Vue mount point into the first class, templates and examples, to achieve click function (zero introd
Vue mount point into the first class, templates and examples, to achieve click function (zero introd

Time:12-14

To rushed to the front door, small make up on learning Vue. Js slippery slope, start from today to share learning path,
Basic knowledge of HTML, JavaScript must be necessary, of course, small make up real-name envy Java a good friend, I was really down in the Java millions times, other good, get into the business, I will be on the direct dry,
First is tools: PC + Hbuilder can, (other compile software to also go, of course)
Preparation: Vue download in Vue. Js's official website http://cn.vuejs.org/click on the learning - & gt; Tutorial - & gt; Find the install (green) - & gt; Development version, the download to the location of the store, they want
The official start of the: open Hbuilder - & gt; Click on the file - & gt; New project - & gt; (name) to create, will just download a Vue. Copy js (Ctr + C) click the project you create posted (Ctr + v), the newly built project right - & gt; New (new) - & gt; HTML file - & gt; Create,
 



<meta charset="utf-8" & gt;
Introduction to the vue & lt;/title> <br/><script SRC="https://bbs.csdn.net/topics/vue.js" & gt; </script> <br/></head> <br/><body> <br/><Div id="root" & gt; <! - mount point between content as a template - & gt; <br/><Div v - on: click="handleClick" & gt; {{content}} & lt;/div> <! - on: -- "v" can be abbreviated to @ & gt; <br/><! - <br/>{{MSG}} & lt; ! <br/> - div as the mount point<H1 & gt; {{number}} & lt;/h1 & gt; <! - interpolation expression {{}} <br/>- & gt; <br/></div> <br/><! - <br/>Interpolation expressions are: <br/><H1 v - text='content' & gt; </h1 & gt; Is shown as & lt; H1 & gt; Hello<H1 & gt; <br/><H1 v - HTML='conent & gt; </h1 & gt; Is shown as the hello <br/>- & gt; <br/></div> <br/><The script type="text/javascript" & gt; <br/>New Vue ({<br/>El: '# root,/* el: for example Vue to take over a particular element, with which a DOM node binding, "#" don't ever forget, Hbuilder not an error, a bug card an afternoon are normal */<br/>/* <br/>Data: {<br/>MSG: 'hello world', <br/>Number: 123 <br/>}, <br/>*/<br/>//data stored data <br/>Data: {<br/>Content: '& lt; H1 & gt; Hello<H1 & gt; '<br/>}, <br/>//method <br/>Methods: {<br/>HandleClick function () {<br/>Enclosing the content="world"//hello after click into world <br/>} <br/>} <br/><br/>}) <br/></script> <br/></body> <br/></html> <br/></pre> <br/>Share for the first time is not very clever child, you will see, more practice, practice today also Vue love dandle (sm) (I) a day!<p class="article - content rp"> CodePudding user response: </p>Suggest you to write a blog, write in that not many people see it<p class="article - content rp"> CodePudding user response: </p>Ha, ha, ha, thank you for reminding me <br/> </div> <div class="th_page th_page_color"></div> <div class="umCopyright"> <p>Page link:<a href="/frontend/94177.html" target="_blank" style="color:#999">https//www.codepudding.com/frontend/94177.html</a></p> </div> <div class="detail-arr"> <div class="detail-arr-left">Prev:<a href='/frontend/94176.html'>Web project home page switch Settings, other functions page will appear in Chinese garbled</a></div> <div class="detail-arr-right">Next:<a href='/frontend/94178.html'>Please recommend a flow chart of pure JS plug-ins</a></div> </div> </div> </div> </div> </div> <div class="container th_top"> <div class="row"> <div class="col-md-12"> <div class="hot-tags neitags"> <ul> <li><i class="iconfont icon-x-tags"></i> Tags:  </li> <a href='/e/tags/?tagname=other' target='_blank'>other</a> </ul> </div> </div> </div> </div> <div class="container th_top"> <div class="row"> <div class="col-md-12"> <div class="xiangguan"> <ul class="msg msghead"> <li class="tbname">Related</li> </ul> <ul> </ul> </div> </div> </div> </div> <div class="container th_top"> <div class="row"> <div class="col-md-12"> <div class="flinks"> <ul> <li><i class="iconfont icon-x-tags"></i> Links:  </li> <li class="liflinks"><a target="_blank" href="/" title="CodePudding">CodePudding</a></li> </ul> </div> </div> </div> </div> <div class="footer"> <p><span style="font-size:16px;color:#666;font-weight: bold">About Us:</span>  <a href="https://www.codepudding.com/contact.html">Contact Us</a>      <a href="https://www.codepudding.com/service.html">Terms of Service</a>      <a href="https://www.codepudding.com/privacy.html"> Privacy Policy</a></p> <p class="foot_info">Copyright © 2010-2023,Powered By <a href="/" target="_blank">CodePudding</a> </p> </div> <script type="text/javascript" src="/skin/code/tianhu.js"></script> </body></html>