2022-10-21

第一个vue.js

    Document        <script src=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/https://cdn.jsdelivr.net/npm/vue/dist/vue.jshttps://www.cnblogs.com/isDaHua/archive/2022/10/23/"><div id=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/apphttps://www.cnblogs.com/isDaHua/archive/2022/10/23/">https://www.cnblogs.com/isDaHua/archive/2022/10/23/    {{message}}https://www.cnblogs.com/isDaHua/archive/2022/10/23/    var app =https://www.cnblogs.com/isDaHua/archive/2022/10/23/ new Vue({    el: https://www.cnblogs.com/isDaHua/archive/2022/10/23/'https://www.cnblogs.com/isDaHua/archive/2022/10/23/#apphttps://www.cnblogs.com/isDaHua/archive/2022/10/23/'https://www.cnblogs.com/isDaHua/archive/2022/10/23/,    data:{        message:https://www.cnblogs.com/isDaHua/archive/2022/10/23/'https://www.cnblogs.com/isDaHua/archive/2022/10/23/Hello Vue!https://www.cnblogs.com/isDaHua/archive/2022/10/23/'https://www.cnblogs.com/isDaHua/archive/2022/10/23/    }})

输出的是“Hello Vue!”。

注意:el:表示的是元素。写的时候一定要加“#”,如果没有加,那么输出的结果是“{{message}}”。

————————————

data 数据:

<html lang=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/enhttps://www.cnblogs.com/isDaHua/archive/2022/10/23/">    <meta charset=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/utf-8https://www.cnblogs.com/isDaHua/archive/2022/10/23/">    Document    <div id=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/apphttps://www.cnblogs.com/isDaHua/archive/2022/10/23/">    <a href=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/javascript:vmhttps://www.cnblogs.com/isDaHua/archive/2022/10/23/">{{message}}    https://www.cnblogs.com/isDaHua/archive/2022/10/23/{{hello}}    
https://www.cnblogs.com/isDaHua/archive/2022/10/23/{{world}}<script type=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/text/javascripthttps://www.cnblogs.com/isDaHua/archive/2022/10/23/">https://www.cnblogs.com/isDaHua/archive/2022/10/23/ var vm =https://www.cnblogs.com/isDaHua/archive/2022/10/23/ new Vue({ el:https://www.cnblogs.com/isDaHua/archive/2022/10/23/'https://www.cnblogs.com/isDaHua/archive/2022/10/23/#apphttps://www.cnblogs.com/isDaHua/archive/2022/10/23/'https://www.cnblogs.com/isDaHua/archive/2022/10/23/, data:{ message:https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/领取优惠券https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/, hello:https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/hi en henghttps://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/, } }}

———————-

v-bind

使用实例:

<html lang=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/enhttps://www.cnblogs.com/isDaHua/archive/2022/10/23/">     <script src=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/https://cdn.jsdelivr.net/npm/vue/dist/vue.jshttps://www.cnblogs.com/isDaHua/archive/2022/10/23/">    Document<div id=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/apphttps://www.cnblogs.com/isDaHua/archive/2022/10/23/">    <a v-bind:href=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/urlhttps://www.cnblogs.com/isDaHua/archive/2022/10/23/">戳我有惊喜    
https://www.cnblogs.com/isDaHua/archive/2022/10/23/<span v-bind:title=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/showmessagehttps://www.cnblogs.com/isDaHua/archive/2022/10/23/">鼠标放在这里https://www.cnblogs.com/isDaHua/archive/2022/10/23/ var vm =https://www.cnblogs.com/isDaHua/archive/2022/10/23/ new Vue({ el:https://www.cnblogs.com/isDaHua/archive/2022/10/23/'https://www.cnblogs.com/isDaHua/archive/2022/10/23/#apphttps://www.cnblogs.com/isDaHua/archive/2022/10/23/'https://www.cnblogs.com/isDaHua/archive/2022/10/23/, data:{ url:https://www.cnblogs.com/isDaHua/archive/2022/10/23/'https://www.cnblogs.com/isDaHua/archive/2022/10/23/http://www.baidu.comhttps://www.cnblogs.com/isDaHua/archive/2022/10/23/'https://www.cnblogs.com/isDaHua/archive/2022/10/23/, showmessage:https://www.cnblogs.com/isDaHua/archive/2022/10/23/'https://www.cnblogs.com/isDaHua/archive/2022/10/23/当前时间是:https://www.cnblogs.com/isDaHua/archive/2022/10/23/'+https://www.cnblogs.com/isDaHua/archive/2022/10/23/new Date().toLocaleString(), } })

  说明:遇到的问题,运行的时候,超链接没有起作用,之后,发现的问题是,在script中没有添加“data”。之后将“data”添加上以后,将“url”和“showmessage”放入,超链接就可以起作用。

——————————–

2022-10-22

———————————

v-if

使用实例

https://www.cnblogs.com/isDaHua/archive/2022/10/23/ 1 https://www.cnblogs.com/isDaHua/archive/2022/10/23/ 2 <html lang=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/enhttps://www.cnblogs.com/isDaHua/archive/2022/10/23/">https://www.cnblogs.com/isDaHua/archive/2022/10/23/ 3 https://www.cnblogs.com/isDaHua/archive/2022/10/23/ 4     <meta charset=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/utf-8https://www.cnblogs.com/isDaHua/archive/2022/10/23/">https://www.cnblogs.com/isDaHua/archive/2022/10/23/ 5     <script src=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/https://cdn.jsdelivr.net/npm/vue/dist/vue.jshttps://www.cnblogs.com/isDaHua/archive/2022/10/23/">https://www.cnblogs.com/isDaHua/archive/2022/10/23/ 6     Documenthttps://www.cnblogs.com/isDaHua/archive/2022/10/23/ 7 https://www.cnblogs.com/isDaHua/archive/2022/10/23/ 8 https://www.cnblogs.com/isDaHua/archive/2022/10/23/ 9 <div id=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/apphttps://www.cnblogs.com/isDaHua/archive/2022/10/23/">https://www.cnblogs.com/isDaHua/archive/2022/10/23/10     https://www.cnblogs.com/isDaHua/archive/2022/10/23/{{message}}https://www.cnblogs.com/isDaHua/archive/2022/10/23/11     
https://www.cnblogs.com/isDaHua/archive/2022/10/23/12 <a href=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/#https://www.cnblogs.com/isDaHua/archive/2022/10/23/" v-https://www.cnblogs.com/isDaHua/archive/2022/10/23/if=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/isLoginhttps://www.cnblogs.com/isDaHua/archive/2022/10/23/">欢迎你归来https://www.cnblogs.com/isDaHua/archive/2022/10/23/13
https://www.cnblogs.com/isDaHua/archive/2022/10/23/14 <a href=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/#https://www.cnblogs.com/isDaHua/archive/2022/10/23/" v-https://www.cnblogs.com/isDaHua/archive/2022/10/23/if=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/level===1https://www.cnblogs.com/isDaHua/archive/2022/10/23/">青铜https://www.cnblogs.com/isDaHua/archive/2022/10/23/15 <a href=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/#https://www.cnblogs.com/isDaHua/archive/2022/10/23/" v-https://www.cnblogs.com/isDaHua/archive/2022/10/23/else-https://www.cnblogs.com/isDaHua/archive/2022/10/23/if=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/level===2https://www.cnblogs.com/isDaHua/archive/2022/10/23/">https://www.cnblogs.com/isDaHua/archive/2022/10/23/16 <a href=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/3https://www.cnblogs.com/isDaHua/archive/2022/10/23/" v-https://www.cnblogs.com/isDaHua/archive/2022/10/23/else=>王者https://www.cnblogs.com/isDaHua/archive/2022/10/23/17
https://www.cnblogs.com/isDaHua/archive/2022/10/23/18 https://www.cnblogs.com/isDaHua/archive/2022/10/23/<span v-id=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/seenhttps://www.cnblogs.com/isDaHua/archive/2022/10/23/">v-https://www.cnblogs.com/isDaHua/archive/2022/10/23/ifhttps://www.cnblogs.com/isDaHua/archive/2022/10/23/19 https://www.cnblogs.com/isDaHua/archive/2022/10/23/<span display= none v-show=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/seenhttps://www.cnblogs.com/isDaHua/archive/2022/10/23/">v-showhttps://www.cnblogs.com/isDaHua/archive/2022/10/23/20 https://www.cnblogs.com/isDaHua/archive/2022/10/23/21 https://www.cnblogs.com/isDaHua/archive/2022/10/23/22 <script type=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/text/javascripthttps://www.cnblogs.com/isDaHua/archive/2022/10/23/">https://www.cnblogs.com/isDaHua/archive/2022/10/23/23 var vm =https://www.cnblogs.com/isDaHua/archive/2022/10/23/ new Vue({https://www.cnblogs.com/isDaHua/archive/2022/10/23/24 el:https://www.cnblogs.com/isDaHua/archive/2022/10/23/'https://www.cnblogs.com/isDaHua/archive/2022/10/23/#apphttps://www.cnblogs.com/isDaHua/archive/2022/10/23/'https://www.cnblogs.com/isDaHua/archive/2022/10/23/,https://www.cnblogs.com/isDaHua/archive/2022/10/23/25 https://www.cnblogs.com/isDaHua/archive/2022/10/23/ data:{https://www.cnblogs.com/isDaHua/archive/2022/10/23/26 message:https://www.cnblogs.com/isDaHua/archive/2022/10/23/'https://www.cnblogs.com/isDaHua/archive/2022/10/23/hellohttps://www.cnblogs.com/isDaHua/archive/2022/10/23/'https://www.cnblogs.com/isDaHua/archive/2022/10/23/,https://www.cnblogs.com/isDaHua/archive/2022/10/23/27 https://www.cnblogs.com/isDaHua/archive/2022/10/23/ isLogin:false,https://www.cnblogs.com/isDaHua/archive/2022/10/23/28 level:1https://www.cnblogs.com/isDaHua/archive/2022/10/23/,https://www.cnblogs.com/isDaHua/archive/2022/10/23/29 https://www.cnblogs.com/isDaHua/archive/2022/10/23/ seen:true,https://www.cnblogs.com/isDaHua/archive/2022/10/23/30 https://www.cnblogs.com/isDaHua/archive/2022/10/23/ }https://www.cnblogs.com/isDaHua/archive/2022/10/23/31 https://www.cnblogs.com/isDaHua/archive/2022/10/23/ })https://www.cnblogs.com/isDaHua/archive/2022/10/23/32 https://www.cnblogs.com/isDaHua/archive/2022/10/23/33

——————-

v-for

实例

https://www.cnblogs.com/isDaHua/archive/2022/10/23/ 1 https://www.cnblogs.com/isDaHua/archive/2022/10/23/ 2 <html lang=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/enhttps://www.cnblogs.com/isDaHua/archive/2022/10/23/">https://www.cnblogs.com/isDaHua/archive/2022/10/23/ 3 https://www.cnblogs.com/isDaHua/archive/2022/10/23/ 4    <script src=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/https://cdn.jsdelivr.net/npm/vue/dist/vue.jshttps://www.cnblogs.com/isDaHua/archive/2022/10/23/">https://www.cnblogs.com/isDaHua/archive/2022/10/23/ 5     Documenthttps://www.cnblogs.com/isDaHua/archive/2022/10/23/ 6 https://www.cnblogs.com/isDaHua/archive/2022/10/23/ 7 https://www.cnblogs.com/isDaHua/archive/2022/10/23/ 8 <div id=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/apphttps://www.cnblogs.com/isDaHua/archive/2022/10/23/">https://www.cnblogs.com/isDaHua/archive/2022/10/23/ 9     https://www.cnblogs.com/isDaHua/archive/2022/10/23/{{message}}https://www.cnblogs.com/isDaHua/archive/2022/10/23/10 https://www.cnblogs.com/isDaHua/archive/2022/10/23/11     
https://www.cnblogs.com/isDaHua/archive/2022/10/23/12
    https://www.cnblogs.com/isDaHua/archive/2022/10/23/13 <li v-https://www.cnblogs.com/isDaHua/archive/2022/10/23/for=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/(item,index) in items https://www.cnblogs.com/isDaHua/archive/2022/10/23/">{{index}} ~~~ {{item}}https://www.cnblogs.com/isDaHua/archive/2022/10/23/14
https://www.cnblogs.com/isDaHua/archive/2022/10/23/15
https://www.cnblogs.com/isDaHua/archive/2022/10/23/16
    https://www.cnblogs.com/isDaHua/archive/2022/10/23/17 <li v-https://www.cnblogs.com/isDaHua/archive/2022/10/23/for=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/(value,key) in objecthttps://www.cnblogs.com/isDaHua/archive/2022/10/23/">{{key}} {{value}}https://www.cnblogs.com/isDaHua/archive/2022/10/23/18
https://www.cnblogs.com/isDaHua/archive/2022/10/23/19
https://www.cnblogs.com/isDaHua/archive/2022/10/23/20
    https://www.cnblogs.com/isDaHua/archive/2022/10/23/21 <li v-https://www.cnblogs.com/isDaHua/archive/2022/10/23/for=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/todo in todoshttps://www.cnblogs.com/isDaHua/archive/2022/10/23/">{{todo.title}}----{{todo.author}}https://www.cnblogs.com/isDaHua/archive/2022/10/23/22
https://www.cnblogs.com/isDaHua/archive/2022/10/23/23 https://www.cnblogs.com/isDaHua/archive/2022/10/23/24 https://www.cnblogs.com/isDaHua/archive/2022/10/23/25 <script type=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/text/javascripthttps://www.cnblogs.com/isDaHua/archive/2022/10/23/">https://www.cnblogs.com/isDaHua/archive/2022/10/23/26 var vm =https://www.cnblogs.com/isDaHua/archive/2022/10/23/ new Vue({https://www.cnblogs.com/isDaHua/archive/2022/10/23/27 el:https://www.cnblogs.com/isDaHua/archive/2022/10/23/'https://www.cnblogs.com/isDaHua/archive/2022/10/23/#apphttps://www.cnblogs.com/isDaHua/archive/2022/10/23/'https://www.cnblogs.com/isDaHua/archive/2022/10/23/,https://www.cnblogs.com/isDaHua/archive/2022/10/23/28 https://www.cnblogs.com/isDaHua/archive/2022/10/23/ data:{https://www.cnblogs.com/isDaHua/archive/2022/10/23/29 message:https://www.cnblogs.com/isDaHua/archive/2022/10/23/'https://www.cnblogs.com/isDaHua/archive/2022/10/23/hellohttps://www.cnblogs.com/isDaHua/archive/2022/10/23/'https://www.cnblogs.com/isDaHua/archive/2022/10/23/,https://www.cnblogs.com/isDaHua/archive/2022/10/23/30 items:[https://www.cnblogs.com/isDaHua/archive/2022/10/23/'https://www.cnblogs.com/isDaHua/archive/2022/10/23/pythonhttps://www.cnblogs.com/isDaHua/archive/2022/10/23/',https://www.cnblogs.com/isDaHua/archive/2022/10/23/'https://www.cnblogs.com/isDaHua/archive/2022/10/23/mysqlhttps://www.cnblogs.com/isDaHua/archive/2022/10/23/',https://www.cnblogs.com/isDaHua/archive/2022/10/23/'https://www.cnblogs.com/isDaHua/archive/2022/10/23/linuxhttps://www.cnblogs.com/isDaHua/archive/2022/10/23/',https://www.cnblogs.com/isDaHua/archive/2022/10/23/'https://www.cnblogs.com/isDaHua/archive/2022/10/23/htmlhttps://www.cnblogs.com/isDaHua/archive/2022/10/23/',https://www.cnblogs.com/isDaHua/archive/2022/10/23/'https://www.cnblogs.com/isDaHua/archive/2022/10/23/csshttps://www.cnblogs.com/isDaHua/archive/2022/10/23/',https://www.cnblogs.com/isDaHua/archive/2022/10/23/'https://www.cnblogs.com/isDaHua/archive/2022/10/23/jshttps://www.cnblogs.com/isDaHua/archive/2022/10/23/'https://www.cnblogs.com/isDaHua/archive/2022/10/23/],https://www.cnblogs.com/isDaHua/archive/2022/10/23/31 https://www.cnblogs.com/isDaHua/archive/2022/10/23/ object:{https://www.cnblogs.com/isDaHua/archive/2022/10/23/32 title:https://www.cnblogs.com/isDaHua/archive/2022/10/23/'https://www.cnblogs.com/isDaHua/archive/2022/10/23/How to do lists in Vuehttps://www.cnblogs.com/isDaHua/archive/2022/10/23/'https://www.cnblogs.com/isDaHua/archive/2022/10/23/,https://www.cnblogs.com/isDaHua/archive/2022/10/23/33 author:https://www.cnblogs.com/isDaHua/archive/2022/10/23/'https://www.cnblogs.com/isDaHua/archive/2022/10/23/Jane Doehttps://www.cnblogs.com/isDaHua/archive/2022/10/23/'https://www.cnblogs.com/isDaHua/archive/2022/10/23/,https://www.cnblogs.com/isDaHua/archive/2022/10/23/34 publishesAt:https://www.cnblogs.com/isDaHua/archive/2022/10/23/'https://www.cnblogs.com/isDaHua/archive/2022/10/23/2016-04-10https://www.cnblogs.com/isDaHua/archive/2022/10/23/'https://www.cnblogs.com/isDaHua/archive/2022/10/23/,https://www.cnblogs.com/isDaHua/archive/2022/10/23/35 https://www.cnblogs.com/isDaHua/archive/2022/10/23/ },https://www.cnblogs.com/isDaHua/archive/2022/10/23/36 https://www.cnblogs.com/isDaHua/archive/2022/10/23/ todos:[https://www.cnblogs.com/isDaHua/archive/2022/10/23/37 https://www.cnblogs.com/isDaHua/archive/2022/10/23/ {https://www.cnblogs.com/isDaHua/archive/2022/10/23/38 title:https://www.cnblogs.com/isDaHua/archive/2022/10/23/'https://www.cnblogs.com/isDaHua/archive/2022/10/23/Vuehttps://www.cnblogs.com/isDaHua/archive/2022/10/23/'https://www.cnblogs.com/isDaHua/archive/2022/10/23/,https://www.cnblogs.com/isDaHua/archive/2022/10/23/39 author:https://www.cnblogs.com/isDaHua/archive/2022/10/23/'https://www.cnblogs.com/isDaHua/archive/2022/10/23/Jane Doehttps://www.cnblogs.com/isDaHua/archive/2022/10/23/'https://www.cnblogs.com/isDaHua/archive/2022/10/23/,https://www.cnblogs.com/isDaHua/archive/2022/10/23/40 publishedAt:https://www.cnblogs.com/isDaHua/archive/2022/10/23/'https://www.cnblogs.com/isDaHua/archive/2022/10/23/2016-04-10https://www.cnblogs.com/isDaHua/archive/2022/10/23/'https://www.cnblogs.com/isDaHua/archive/2022/10/23/,https://www.cnblogs.com/isDaHua/archive/2022/10/23/41 https://www.cnblogs.com/isDaHua/archive/2022/10/23/ },https://www.cnblogs.com/isDaHua/archive/2022/10/23/42 https://www.cnblogs.com/isDaHua/archive/2022/10/23/ {https://www.cnblogs.com/isDaHua/archive/2022/10/23/43 title:https://www.cnblogs.com/isDaHua/archive/2022/10/23/'https://www.cnblogs.com/isDaHua/archive/2022/10/23/pythonhttps://www.cnblogs.com/isDaHua/archive/2022/10/23/'https://www.cnblogs.com/isDaHua/archive/2022/10/23/,https://www.cnblogs.com/isDaHua/archive/2022/10/23/44 author:https://www.cnblogs.com/isDaHua/archive/2022/10/23/'https://www.cnblogs.com/isDaHua/archive/2022/10/23/Rickyhttps://www.cnblogs.com/isDaHua/archive/2022/10/23/'https://www.cnblogs.com/isDaHua/archive/2022/10/23/,https://www.cnblogs.com/isDaHua/archive/2022/10/23/45 publishedAt:https://www.cnblogs.com/isDaHua/archive/2022/10/23/'https://www.cnblogs.com/isDaHua/archive/2022/10/23/2019-04-10https://www.cnblogs.com/isDaHua/archive/2022/10/23/'https://www.cnblogs.com/isDaHua/archive/2022/10/23/,https://www.cnblogs.com/isDaHua/archive/2022/10/23/46 https://www.cnblogs.com/isDaHua/archive/2022/10/23/ },https://www.cnblogs.com/isDaHua/archive/2022/10/23/47 https://www.cnblogs.com/isDaHua/archive/2022/10/23/48 https://www.cnblogs.com/isDaHua/archive/2022/10/23/ ]https://www.cnblogs.com/isDaHua/archive/2022/10/23/49 https://www.cnblogs.com/isDaHua/archive/2022/10/23/ }https://www.cnblogs.com/isDaHua/archive/2022/10/23/50 https://www.cnblogs.com/isDaHua/archive/2022/10/23/51 https://www.cnblogs.com/isDaHua/archive/2022/10/23/ })https://www.cnblogs.com/isDaHua/archive/2022/10/23/52 https://www.cnblogs.com/isDaHua/archive/2022/10/23/53

  说明:注意,在第36行往下,如果只是写“[title:” “,author:” “]”,里面没有填写数据的时候,在浏览器中显示的只有“{{message}}”等等,不会显示内部的字符。

—————————–

methods方法:

使用实例

https://www.cnblogs.com/isDaHua/archive/2022/10/23/ 1 https://www.cnblogs.com/isDaHua/archive/2022/10/23/ 2 <html lang=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/enhttps://www.cnblogs.com/isDaHua/archive/2022/10/23/">https://www.cnblogs.com/isDaHua/archive/2022/10/23/ 3 https://www.cnblogs.com/isDaHua/archive/2022/10/23/ 4     <meta charset=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/utf-8https://www.cnblogs.com/isDaHua/archive/2022/10/23/">https://www.cnblogs.com/isDaHua/archive/2022/10/23/ 5    <script src=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/https://cdn.jsdelivr.net/npm/vue/dist/vue.jshttps://www.cnblogs.com/isDaHua/archive/2022/10/23/">https://www.cnblogs.com/isDaHua/archive/2022/10/23/ 6     Documenthttps://www.cnblogs.com/isDaHua/archive/2022/10/23/ 7 https://www.cnblogs.com/isDaHua/archive/2022/10/23/ 8 https://www.cnblogs.com/isDaHua/archive/2022/10/23/ 9 <div id=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/apphttps://www.cnblogs.com/isDaHua/archive/2022/10/23/">https://www.cnblogs.com/isDaHua/archive/2022/10/23/10     https://www.cnblogs.com/isDaHua/archive/2022/10/23/{{message}}https://www.cnblogs.com/isDaHua/archive/2022/10/23/11     <button v-on:click=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/loginhttps://www.cnblogs.com/isDaHua/archive/2022/10/23/">登陆
https://www.cnblogs.com/isDaHua/archive/2022/10/23/12 <a href=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/javascript:;https://www.cnblogs.com/isDaHua/archive/2022/10/23/" @click=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/registerhttps://www.cnblogs.com/isDaHua/archive/2022/10/23/">注册https://www.cnblogs.com/isDaHua/archive/2022/10/23/13 https://www.cnblogs.com/isDaHua/archive/2022/10/23/14
https://www.cnblogs.com/isDaHua/archive/2022/10/23/15 <button @click=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/add(counter)https://www.cnblogs.com/isDaHua/archive/2022/10/23/">点击+1https://www.cnblogs.com/isDaHua/archive/2022/10/23/16 https://www.cnblogs.com/isDaHua/archive/2022/10/23/17 https://www.cnblogs.com/isDaHua/archive/2022/10/23/18 <script type=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/text/javascripthttps://www.cnblogs.com/isDaHua/archive/2022/10/23/">https://www.cnblogs.com/isDaHua/archive/2022/10/23/19 var vm =https://www.cnblogs.com/isDaHua/archive/2022/10/23/ new Vue({https://www.cnblogs.com/isDaHua/archive/2022/10/23/20 el:https://www.cnblogs.com/isDaHua/archive/2022/10/23/'https://www.cnblogs.com/isDaHua/archive/2022/10/23/#apphttps://www.cnblogs.com/isDaHua/archive/2022/10/23/'https://www.cnblogs.com/isDaHua/archive/2022/10/23/,https://www.cnblogs.com/isDaHua/archive/2022/10/23/21 https://www.cnblogs.com/isDaHua/archive/2022/10/23/ data:{https://www.cnblogs.com/isDaHua/archive/2022/10/23/22 message:https://www.cnblogs.com/isDaHua/archive/2022/10/23/'https://www.cnblogs.com/isDaHua/archive/2022/10/23/hellohttps://www.cnblogs.com/isDaHua/archive/2022/10/23/'https://www.cnblogs.com/isDaHua/archive/2022/10/23/,https://www.cnblogs.com/isDaHua/archive/2022/10/23/23 counter:1https://www.cnblogs.com/isDaHua/archive/2022/10/23/,https://www.cnblogs.com/isDaHua/archive/2022/10/23/24 https://www.cnblogs.com/isDaHua/archive/2022/10/23/ total:0,https://www.cnblogs.com/isDaHua/archive/2022/10/23/25 https://www.cnblogs.com/isDaHua/archive/2022/10/23/ },https://www.cnblogs.com/isDaHua/archive/2022/10/23/26 https://www.cnblogs.com/isDaHua/archive/2022/10/23/ methods:{https://www.cnblogs.com/isDaHua/archive/2022/10/23/27 https://www.cnblogs.com/isDaHua/archive/2022/10/23/ login:function(){https://www.cnblogs.com/isDaHua/archive/2022/10/23/28 alert(https://www.cnblogs.com/isDaHua/archive/2022/10/23/'https://www.cnblogs.com/isDaHua/archive/2022/10/23/我被点击了https://www.cnblogs.com/isDaHua/archive/2022/10/23/'https://www.cnblogs.com/isDaHua/archive/2022/10/23/)https://www.cnblogs.com/isDaHua/archive/2022/10/23/29 https://www.cnblogs.com/isDaHua/archive/2022/10/23/ },https://www.cnblogs.com/isDaHua/archive/2022/10/23/30 https://www.cnblogs.com/isDaHua/archive/2022/10/23/ register:function(){https://www.cnblogs.com/isDaHua/archive/2022/10/23/31 alert(https://www.cnblogs.com/isDaHua/archive/2022/10/23/'https://www.cnblogs.com/isDaHua/archive/2022/10/23/注册了https://www.cnblogs.com/isDaHua/archive/2022/10/23/'https://www.cnblogs.com/isDaHua/archive/2022/10/23/)https://www.cnblogs.com/isDaHua/archive/2022/10/23/32 https://www.cnblogs.com/isDaHua/archive/2022/10/23/ },https://www.cnblogs.com/isDaHua/archive/2022/10/23/33 https://www.cnblogs.com/isDaHua/archive/2022/10/23/ add:function(counter){https://www.cnblogs.com/isDaHua/archive/2022/10/23/34 this.total+=https://www.cnblogs.com/isDaHua/archive/2022/10/23/counter;https://www.cnblogs.com/isDaHua/archive/2022/10/23/35 https://www.cnblogs.com/isDaHua/archive/2022/10/23/ alert(this.total)https://www.cnblogs.com/isDaHua/archive/2022/10/23/36 https://www.cnblogs.com/isDaHua/archive/2022/10/23/ }https://www.cnblogs.com/isDaHua/archive/2022/10/23/37 https://www.cnblogs.com/isDaHua/archive/2022/10/23/ }https://www.cnblogs.com/isDaHua/archive/2022/10/23/38 https://www.cnblogs.com/isDaHua/archive/2022/10/23/ })https://www.cnblogs.com/isDaHua/archive/2022/10/23/39 https://www.cnblogs.com/isDaHua/archive/2022/10/23/40

    说明:上面是正确的代码,刚开始遇到的问题是,点击“登陆”后,没有弹窗,就很奇怪。之后,换了Vue文档中的代码,发现可以运行,那就是点击函数有问题,后来发现它拼写有误。正确的拼写是“alert”,而不是“alter”。一定要注意。

——————————–

v-model绑定事件

https://www.cnblogs.com/isDaHua/archive/2022/10/23/ 1 https://www.cnblogs.com/isDaHua/archive/2022/10/23/ 2 <html lang=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/enhttps://www.cnblogs.com/isDaHua/archive/2022/10/23/">https://www.cnblogs.com/isDaHua/archive/2022/10/23/ 3 https://www.cnblogs.com/isDaHua/archive/2022/10/23/ 4     <meta charset=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/utf-8https://www.cnblogs.com/isDaHua/archive/2022/10/23/">https://www.cnblogs.com/isDaHua/archive/2022/10/23/ 5    <script src=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/https://cdn.jsdelivr.net/npm/vue/dist/vue.jshttps://www.cnblogs.com/isDaHua/archive/2022/10/23/">https://www.cnblogs.com/isDaHua/archive/2022/10/23/ 6     Documenthttps://www.cnblogs.com/isDaHua/archive/2022/10/23/ 7 https://www.cnblogs.com/isDaHua/archive/2022/10/23/ 8 https://www.cnblogs.com/isDaHua/archive/2022/10/23/ 9 <div id=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/apphttps://www.cnblogs.com/isDaHua/archive/2022/10/23/">https://www.cnblogs.com/isDaHua/archive/2022/10/23/10     https://www.cnblogs.com/isDaHua/archive/2022/10/23/{{message}}https://www.cnblogs.com/isDaHua/archive/2022/10/23/11     
https://www.cnblogs.com/isDaHua/archive/2022/10/23/12 https://www.cnblogs.com/isDaHua/archive/2022/10/23/13https://www.cnblogs.com/isDaHua/archive/2022/10/23/14https://www.cnblogs.com/isDaHua/archive/2022/10/23/15https://www.cnblogs.com/isDaHua/archive/2022/10/23/16https://www.cnblogs.com/isDaHua/archive/2022/10/23/17https://www.cnblogs.com/isDaHua/archive/2022/10/23/21https://www.cnblogs.com/isDaHua/archive/2022/10/23/22https://www.cnblogs.com/isDaHua/archive/2022/10/23/23https://www.cnblogs.com/isDaHua/archive/2022/10/23/24https://www.cnblogs.com/isDaHua/archive/2022/10/23/25https://www.cnblogs.com/isDaHua/archive/2022/10/23/26https://www.cnblogs.com/isDaHua/archive/2022/10/23/27https://www.cnblogs.com/isDaHua/archive/2022/10/23/28
用户名<input type=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/texthttps://www.cnblogs.com/isDaHua/archive/2022/10/23/" name=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/usernamehttps://www.cnblogs.com/isDaHua/archive/2022/10/23/" v-model=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/usernamehttps://www.cnblogs.com/isDaHua/archive/2022/10/23/">
密码<input type=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/passwordhttps://www.cnblogs.com/isDaHua/archive/2022/10/23/" name=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/passwordhttps://www.cnblogs.com/isDaHua/archive/2022/10/23/" v-model=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/password1https://www.cnblogs.com/isDaHua/archive/2022/10/23/">
确认密码<input type=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/passwordhttps://www.cnblogs.com/isDaHua/archive/2022/10/23/" name=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/passwordhttps://www.cnblogs.com/isDaHua/archive/2022/10/23/" v-model=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/password2https://www.cnblogs.com/isDaHua/archive/2022/10/23/">
性别 https://www.cnblogs.com/isDaHua/archive/2022/10/23/18 男<input type=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/radiohttps://www.cnblogs.com/isDaHua/archive/2022/10/23/" name=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/sexhttps://www.cnblogs.com/isDaHua/archive/2022/10/23/" value=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/boyhttps://www.cnblogs.com/isDaHua/archive/2022/10/23/" v-model=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/sexhttps://www.cnblogs.com/isDaHua/archive/2022/10/23/">https://www.cnblogs.com/isDaHua/archive/2022/10/23/19 女<input type=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/radiohttps://www.cnblogs.com/isDaHua/archive/2022/10/23/" name=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/sexhttps://www.cnblogs.com/isDaHua/archive/2022/10/23/" value=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/girlhttps://www.cnblogs.com/isDaHua/archive/2022/10/23/" v-model=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/sexhttps://www.cnblogs.com/isDaHua/archive/2022/10/23/">https://www.cnblogs.com/isDaHua/archive/2022/10/23/20
爱好 足球<input type=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/checkboxhttps://www.cnblogs.com/isDaHua/archive/2022/10/23/" name=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/likehttps://www.cnblogs.com/isDaHua/archive/2022/10/23/" value=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/足球https://www.cnblogs.com/isDaHua/archive/2022/10/23/" v-model=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/likehttps://www.cnblogs.com/isDaHua/archive/2022/10/23/"> 篮球<input type=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/checkboxhttps://www.cnblogs.com/isDaHua/archive/2022/10/23/" name=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/likehttps://www.cnblogs.com/isDaHua/archive/2022/10/23/" value=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/篮球https://www.cnblogs.com/isDaHua/archive/2022/10/23/" v-model=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/likehttps://www.cnblogs.com/isDaHua/archive/2022/10/23/"> 乒乓球<input type=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/checkboxhttps://www.cnblogs.com/isDaHua/archive/2022/10/23/" name=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/likehttps://www.cnblogs.com/isDaHua/archive/2022/10/23/" value=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/乒乓球https://www.cnblogs.com/isDaHua/archive/2022/10/23/" v-model=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/likehttps://www.cnblogs.com/isDaHua/archive/2022/10/23/">
https://www.cnblogs.com/isDaHua/archive/2022/10/23/29 <button v-on:click=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/registerhttps://www.cnblogs.com/isDaHua/archive/2022/10/23/">注册https://www.cnblogs.com/isDaHua/archive/2022/10/23/30 https://www.cnblogs.com/isDaHua/archive/2022/10/23/31 https://www.cnblogs.com/isDaHua/archive/2022/10/23/32 <script type=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/text/javascripthttps://www.cnblogs.com/isDaHua/archive/2022/10/23/">https://www.cnblogs.com/isDaHua/archive/2022/10/23/33 var vm =https://www.cnblogs.com/isDaHua/archive/2022/10/23/ new Vue({https://www.cnblogs.com/isDaHua/archive/2022/10/23/34 el:https://www.cnblogs.com/isDaHua/archive/2022/10/23/'https://www.cnblogs.com/isDaHua/archive/2022/10/23/#apphttps://www.cnblogs.com/isDaHua/archive/2022/10/23/'https://www.cnblogs.com/isDaHua/archive/2022/10/23/,https://www.cnblogs.com/isDaHua/archive/2022/10/23/35 https://www.cnblogs.com/isDaHua/archive/2022/10/23/ data:{https://www.cnblogs.com/isDaHua/archive/2022/10/23/36 message:https://www.cnblogs.com/isDaHua/archive/2022/10/23/'https://www.cnblogs.com/isDaHua/archive/2022/10/23/hellohttps://www.cnblogs.com/isDaHua/archive/2022/10/23/'https://www.cnblogs.com/isDaHua/archive/2022/10/23/,https://www.cnblogs.com/isDaHua/archive/2022/10/23/37 username:https://www.cnblogs.com/isDaHua/archive/2022/10/23/''https://www.cnblogs.com/isDaHua/archive/2022/10/23/,https://www.cnblogs.com/isDaHua/archive/2022/10/23/38 password1:https://www.cnblogs.com/isDaHua/archive/2022/10/23/''https://www.cnblogs.com/isDaHua/archive/2022/10/23/,https://www.cnblogs.com/isDaHua/archive/2022/10/23/39 password2:https://www.cnblogs.com/isDaHua/archive/2022/10/23/''https://www.cnblogs.com/isDaHua/archive/2022/10/23/,https://www.cnblogs.com/isDaHua/archive/2022/10/23/40 sex:https://www.cnblogs.com/isDaHua/archive/2022/10/23/''https://www.cnblogs.com/isDaHua/archive/2022/10/23/,https://www.cnblogs.com/isDaHua/archive/2022/10/23/41 https://www.cnblogs.com/isDaHua/archive/2022/10/23/ like:[],https://www.cnblogs.com/isDaHua/archive/2022/10/23/42 https://www.cnblogs.com/isDaHua/archive/2022/10/23/ },https://www.cnblogs.com/isDaHua/archive/2022/10/23/43 https://www.cnblogs.com/isDaHua/archive/2022/10/23/ methods:{https://www.cnblogs.com/isDaHua/archive/2022/10/23/44 https://www.cnblogs.com/isDaHua/archive/2022/10/23/ register:function(){https://www.cnblogs.com/isDaHua/archive/2022/10/23/45 alert(this.username + this.password1 + this.password1 + this.sex +https://www.cnblogs.com/isDaHua/archive/2022/10/23/ this.like)https://www.cnblogs.com/isDaHua/archive/2022/10/23/46 https://www.cnblogs.com/isDaHua/archive/2022/10/23/ }https://www.cnblogs.com/isDaHua/archive/2022/10/23/47 https://www.cnblogs.com/isDaHua/archive/2022/10/23/ }https://www.cnblogs.com/isDaHua/archive/2022/10/23/48 https://www.cnblogs.com/isDaHua/archive/2022/10/23/ })https://www.cnblogs.com/isDaHua/archive/2022/10/23/49 https://www.cnblogs.com/isDaHua/archive/2022/10/23/50

——————–

todalist实例

https://www.cnblogs.com/isDaHua/archive/2022/10/23/ 1 https://www.cnblogs.com/isDaHua/archive/2022/10/23/ 2 <html lang=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/enhttps://www.cnblogs.com/isDaHua/archive/2022/10/23/">https://www.cnblogs.com/isDaHua/archive/2022/10/23/ 3 https://www.cnblogs.com/isDaHua/archive/2022/10/23/ 4     <meta charset=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/UTF-8https://www.cnblogs.com/isDaHua/archive/2022/10/23/">https://www.cnblogs.com/isDaHua/archive/2022/10/23/ 5     <script src=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/https://cdn.jsdelivr.net/npm/vue/dist/vue.jshttps://www.cnblogs.com/isDaHua/archive/2022/10/23/">https://www.cnblogs.com/isDaHua/archive/2022/10/23/ 6     Documenthttps://www.cnblogs.com/isDaHua/archive/2022/10/23/ 7 https://www.cnblogs.com/isDaHua/archive/2022/10/23/ 8 https://www.cnblogs.com/isDaHua/archive/2022/10/23/ 9 <div id=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/apphttps://www.cnblogs.com/isDaHua/archive/2022/10/23/">https://www.cnblogs.com/isDaHua/archive/2022/10/23/10      https://www.cnblogs.com/isDaHua/archive/2022/10/23/{{message}}https://www.cnblogs.com/isDaHua/archive/2022/10/23/11     <input type=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/texthttps://www.cnblogs.com/isDaHua/archive/2022/10/23/" name=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/todoitemhttps://www.cnblogs.com/isDaHua/archive/2022/10/23/" v-model=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/newitemhttps://www.cnblogs.com/isDaHua/archive/2022/10/23/"><button @click=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/addhttps://www.cnblogs.com/isDaHua/archive/2022/10/23/">添加https://www.cnblogs.com/isDaHua/archive/2022/10/23/12     
https://www.cnblogs.com/isDaHua/archive/2022/10/23/13
    https://www.cnblogs.com/isDaHua/archive/2022/10/23/14 <!-- <li v-https://www.cnblogs.com/isDaHua/archive/2022/10/23/for=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/item in itemshttps://www.cnblogs.com/isDaHua/archive/2022/10/23/">{{item}}-->https://www.cnblogs.com/isDaHua/archive/2022/10/23/15 <li v-https://www.cnblogs.com/isDaHua/archive/2022/10/23/for=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/(item,index) in itemshttps://www.cnblogs.com/isDaHua/archive/2022/10/23/">https://www.cnblogs.com/isDaHua/archive/2022/10/23/16 <a href=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/javascript:;https://www.cnblogs.com/isDaHua/archive/2022/10/23/" @click=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/up(index)https://www.cnblogs.com/isDaHua/archive/2022/10/23/">↑https://www.cnblogs.com/isDaHua/archive/2022/10/23/17 {{item}} <a href=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/javascript:;https://www.cnblogs.com/isDaHua/archive/2022/10/23/" @click=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/deleteitem(index)https://www.cnblogs.com/isDaHua/archive/2022/10/23/">删除https://www.cnblogs.com/isDaHua/archive/2022/10/23/18 <a href=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/javascript:;https://www.cnblogs.com/isDaHua/archive/2022/10/23/" @click=https://www.cnblogs.com/isDaHua/archive/2022/10/23/"https://www.cnblogs.com/isDaHua/archive/2022/10/23/down(index)https://www.cnblogs.com/isDaHua/archive/2022/10/23/">↓https://www.cnblogs.com/isDaHua/archive/2022/10/23/19 https://www.cnblogs.com/isDaHua/archive/2022/10/23/20
https://www.cnblogs.com/isDaHua/archive/2022/10/23/21 https://www.cnblogs.com/isDaHua/archive/2022/10/23/22 https://www.cnblogs.com/isDaHua/archive/2022/10/23/23 https://www.cnblogs.com/isDaHua/archive/2022/10/23/24 var vm =https://www.cnblogs.com/isDaHua/archive/2022/10/23/ new Vue({https://www.cnblogs.com/isDaHua/archive/2022/10/23/25 el:https://www.cnblogs.com/isDaHua/archive/2022/10/23/'https://www.cnblogs.com/isDaHua/archive/2022/10/23/#apphttps://www.cnblogs.com/isDaHua/archive/2022/10/23/'https://www.cnblogs.com/isDaHua/archive/2022/10/23/,https://www.cnblogs.com/isDaHua/archive/2022/10/23/26 https://www.cnblogs.com/isDaHua/archive/2022/10/23/ data:{https://www.cnblogs.com/isDaHua/archive/2022/10/23/27 message:https://www.cnblogs.com/isDaHua/archive/2022/10/23/'https://www.cnblogs.com/isDaHua/archive/2022/10/23/hellohttps://www.cnblogs.com/isDaHua/archive/2022/10/23/'https://www.cnblogs.com/isDaHua/archive/2022/10/23/,https://www.cnblogs.com/isDaHua/archive/2022/10/23/28 items:[https://www.cnblogs.com/isDaHua/archive/2022/10/23/'https://www.cnblogs.com/isDaHua/archive/2022/10/23/学习htmlhttps://www.cnblogs.com/isDaHua/archive/2022/10/23/',https://www.cnblogs.com/isDaHua/archive/2022/10/23/'https://www.cnblogs.com/isDaHua/archive/2022/10/23/学习pythonhttps://www.cnblogs.com/isDaHua/archive/2022/10/23/',https://www.cnblogs.com/isDaHua/archive/2022/10/23/'https://www.cnblogs.com/isDaHua/archive/2022/10/23/学习mysqlhttps://www.cnblogs.com/isDaHua/archive/2022/10/23/'https://www.cnblogs.com/isDaHua/archive/2022/10/23/],https://www.cnblogs.com/isDaHua/archive/2022/10/23/29 newitem:https://www.cnblogs.com/isDaHua/archive/2022/10/23/''https://www.cnblogs.com/isDaHua/archive/2022/10/23/30 https://www.cnblogs.com/isDaHua/archive/2022/10/23/ },https://www.cnblogs.com/isDaHua/archive/2022/10/23/31 https://www.cnblogs.com/isDaHua/archive/2022/10/23/ methods:{https://www.cnblogs.com/isDaHua/archive/2022/10/23/32 https://www.cnblogs.com/isDaHua/archive/2022/10/23/ add:function(){https://www.cnblogs.com/isDaHua/archive/2022/10/23/33 https://www.cnblogs.com/isDaHua/archive/2022/10/23/ this.items.push(this.newitem);https://www.cnblogs.com/isDaHua/archive/2022/10/23/34 this.newitem=https://www.cnblogs.com/isDaHua/archive/2022/10/23/''https://www.cnblogs.com/isDaHua/archive/2022/10/23/;https://www.cnblogs.com/isDaHua/archive/2022/10/23/35 https://www.cnblogs.com/isDaHua/archive/2022/10/23/ },https://www.cnblogs.com/isDaHua/archive/2022/10/23/36 https://www.cnblogs.com/isDaHua/archive/2022/10/23/ deleteitem:function(index){https://www.cnblogs.com/isDaHua/archive/2022/10/23/37 this.items.splice(index,1https://www.cnblogs.com/isDaHua/archive/2022/10/23/);https://www.cnblogs.com/isDaHua/archive/2022/10/23/38 https://www.cnblogs.com/isDaHua/archive/2022/10/23/ },https://www.cnblogs.com/isDaHua/archive/2022/10/23/39 https://www.cnblogs.com/isDaHua/archive/2022/10/23/ down:function(index){https://www.cnblogs.com/isDaHua/archive/2022/10/23/40 //1https://www.cnblogs.com/isDaHua/archive/2022/10/23/.获取当前的元素https://www.cnblogs.com/isDaHua/archive/2022/10/23/41 current =https://www.cnblogs.com/isDaHua/archive/2022/10/23/ this.items[index]https://www.cnblogs.com/isDaHua/archive/2022/10/23/42 //2https://www.cnblogs.com/isDaHua/archive/2022/10/23/.先把当前元素删除https://www.cnblogs.com/isDaHua/archive/2022/10/23/43 this.items.splice(index,1https://www.cnblogs.com/isDaHua/archive/2022/10/23/)https://www.cnblogs.com/isDaHua/archive/2022/10/23/44 //3https://www.cnblogs.com/isDaHua/archive/2022/10/23/.再添加,添加的时候让它的索引减1https://www.cnblogs.com/isDaHua/archive/2022/10/23/45 this.items.splice(index+1https://www.cnblogs.com/isDaHua/archive/2022/10/23/,0,current)https://www.cnblogs.com/isDaHua/archive/2022/10/23/46 https://www.cnblogs.com/isDaHua/archive/2022/10/23/ },https://www.cnblogs.com/isDaHua/archive/2022/10/23/47 https://www.cnblogs.com/isDaHua/archive/2022/10/23/ up:function(index){https://www.cnblogs.com/isDaHua/archive/2022/10/23/48 //1https://www.cnblogs.com/isDaHua/archive/2022/10/23/.获取当前的元素https://www.cnblogs.com/isDaHua/archive/2022/10/23/49 current =https://www.cnblogs.com/isDaHua/archive/2022/10/23/ this.items[index]https://www.cnblogs.com/isDaHua/archive/2022/10/23/50 //2https://www.cnblogs.com/isDaHua/archive/2022/10/23/.先把当前元素删除https://www.cnblogs.com/isDaHua/archive/2022/10/23/51 this.items.splice(index,1https://www.cnblogs.com/isDaHua/archive/2022/10/23/)https://www.cnblogs.com/isDaHua/archive/2022/10/23/52 //3https://www.cnblogs.com/isDaHua/archive/2022/10/23/.再添加,添加的时候让它的索引减1https://www.cnblogs.com/isDaHua/archive/2022/10/23/53 this.items.splice(index-1https://www.cnblogs.com/isDaHua/archive/2022/10/23/,0,current)https://www.cnblogs.com/isDaHua/archive/2022/10/23/54 https://www.cnblogs.com/isDaHua/archive/2022/10/23/ }https://www.cnblogs.com/isDaHua/archive/2022/10/23/55 https://www.cnblogs.com/isDaHua/archive/2022/10/23/ }https://www.cnblogs.com/isDaHua/archive/2022/10/23/56 https://www.cnblogs.com/isDaHua/archive/2022/10/23/ })https://www.cnblogs.com/isDaHua/archive/2022/10/23/57 https://www.cnblogs.com/isDaHua/archive/2022/10/23/58

    说明:注意第34行,添加元素后,将文本框里面的内容设置为空,是“=”,不是“:”,如果写反了,结果就出不开。第36行中,删除的函数中要传递一个索引。第51行中,如果是删除一个元素,那么使用的参数有两个,处理“index”外,还有要删除的元素的个数。若删除一个那么第二个参数写上1。如果没有写参数的话,那么它就默认是删除除本身以外下面的所有。此处表示上移后,将下面的值都删除了。