标签:div view nbsp key ice http cli cal type
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>vue 入门</title> <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script> </head> <body> <div id="app"> <div> <input type="text" v-model="inputValue"> <button @click="add">提交</button> </div> <ul> <li v-for="(item,index) in list" :key="index" @dblclick="del(index)"> {{ item }}</li> </ul> </div> <script> new Vue({ el:"#app", data:{ inputValue:‘‘, list:[] }, methods:{ add() { this.list.push(this.inputValue) this.inputValue = ‘‘ }, del(index){ this.list.splice(index,1) } } }) </script> </body> </html>
标签:div view nbsp key ice http cli cal type
原文地址:https://www.cnblogs.com/php-linux/p/11617257.html