1.vue的引入
离线引用:下载vue的js文件(地址:https://cdn.jsdelivr.net/npm/vue/dist/vue.js),添加到前端项目,
在网页中通过script标签引用vue.js文件。
<script src="js/vue.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
2.简单的vue使用:
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title></title> <script src="js/vue.js"></script> </head> <body> <div id="container"> 从vm中获取的数据为:{{str}} </div> <script type="text/javascript"> var vm = new Vue({ el:"#container", data:{ str:"cqyzs" } }); </script> </body> </html>
原文链接:https://blog.csdn.net/LYly_B/article/details/125722737?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522165934461816782395392342%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fblog.%2522%257D&request_id=165934461816782395392342&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~blog~first_rank_ecpm_v1~times_rank-29-125722737-null-null.nonecase&utm_term=%E6%90%AD%E5%BB%BAcdn
原创文章,作者:优速盾-小U,如若转载,请注明出处:https://www.cdnb.net/bbs/archives/8090