web-vue

复制代码
<html>
    <head>
        <title>永远朋友</title>
        <script src="../js/vue.js"></script>
    </head>
    <body>
        <div id = "app">
            <input type="text" v-model="message">
            {{ message }}
        </div>
    </body>
    <script>
        new Vue({
            el : "#app",
            data : {
                message:"hello vue!"
            }
        })
    </script>
</html>
复制代码
<html>
    <head>
        <script src = "../js/vue.js"></script>
    </head>
    <body>
         <div id="app"> 
            <a v-bind:href = "u">链接1</a>
            <a :href= "u">链接2</a>
            <input type="text" v-model="u">
         </div>
    </body>
    <script>
        new Vue({
            el:"#app",
            data:{
                u:"https://www.baidu.com"
            }
        })
    </script>
</html>
复制代码
<html>
    <head>
        <script src="../js/vue.js"></script>
    </head>
    <body>
        <div id = "app">
            <table border="1" cellspacing="0" width="60%">
                <tr>
                    <th>编号</th>
                    <th>姓名</th>
                    <th>年龄</th>
                    <th>性别</th>
                    <th>成绩</th>
                    <th>等级</th>
                </tr>
                <tr align="center" v-for="(user, index) in users">
                    <td>{{index+1}}</td>
                    <td>{{user.name}}</td>
                    <td>{{user.age}}</td>
                    <td><span v-if="user.gender == 2">女</span>
                        <span v-else="user.gender == 1">男</span></td>
                    <td>{{user.socre}}</td>
                    <td><span v-if="user.socre < 60" style="color: red;">不及格</span>
                          <span v-else-if="user.socre >= 60 && user.socre < 80">及格</span>
                        <span v-else="user.socre >= 80">优秀</span></tr>

                </tr>
            </table>
        </div>
    </body>
    <script>
        new Vue({
            el : "#app",
            data : {
                users:[{
                    name:"Tom",
                    age:18,
                    gender:1,
                    socre:99
                },{
                    name:"john",
                    age:19,
                    gender:2,
                    socre:79
                },{
                    name:"ave",
                    age:23,
                    gender:2,
                    socre:56
                } ]
            },
        })
    </script>
</html>
相关推荐
爱上妖精的尾巴3 分钟前
6-4 WPS JS宏 不重复随机取值应用
开发语言·前端·javascript
似水流年QC30 分钟前
深入探索 WebHID:Web 标准下的硬件交互实现
前端·交互·webhid
陪我去看海38 分钟前
测试 mcp
前端
speedoooo1 小时前
在现有App里嵌入一个AI协作者
前端·ui·小程序·前端框架·web app
全栈胖叔叔-瓜州1 小时前
关于llamasharp 大模型多轮对话,模型对话无法终止,或者输出角色标识User:,或者System等角色标识问题。
前端·人工智能
三七吃山漆2 小时前
攻防世界——wife_wife
前端·javascript·web安全·网络安全·ctf
用户47949283569152 小时前
面试官问"try-catch影响性能吗",我用数据打脸
前端·javascript·面试
GISer_Jing2 小时前
前端营销技术实战:数据+AI实战指南
前端·javascript·人工智能
GIS之路2 小时前
使用命令行工具 ogr2ogr 将 CSV 转换为 Shp 数据(二)
前端
嘉琪0013 小时前
Vue3+JS 高级前端面试题
开发语言·前端·javascript