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>
相关推荐
众创岛4 分钟前
iframe的属性获取
开发语言·javascript·ecmascript
小陈工15 分钟前
Python Web开发入门(十一):RESTful API设计原则与最佳实践——让你的API既优雅又好用
开发语言·前端·人工智能·后端·python·安全·restful
星空18 分钟前
前段--A_2--HTML属性标签
前端·html
三万棵雪松33 分钟前
【Linux 物联网网关主控系统-Web部分(一)】
linux·前端·嵌入式linux
摸鱼仙人~1 小时前
增量快照 vs 结构化共享:适用场景全解析
前端·vue.js
2301_771717211 小时前
Jackson的使用方法详解
java·服务器·前端
A923A1 小时前
【小兔鲜电商前台 | 项目笔记】第八天
前端·vue.js·笔记·项目·小兔鲜
DYuW5gBmH1 小时前
Chrome DevTools MCP 让 AI 无缝接管浏览器调试会话
前端·chrome·chrome devtools
echome8882 小时前
JavaScript Promise 与 async/await 实战:5 个高频异步编程场景的优雅解决方案
开发语言·javascript·ecmascript
qq12_8115175152 小时前
Java Web 影城会员管理系统系统源码-SpringBoot2+Vue3+MyBatis-Plus+MySQL8.0【含文档】
java·前端·mybatis