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>
相关推荐
White graces6 分钟前
正则表达式效验邮箱格式, 手机号格式, 密码长度
前端·spring boot·spring·正则表达式·java-ee·maven·intellij-idea
庸俗今天不摸鱼7 分钟前
Canvas进阶-4、边界检测(流光,鼠标拖尾)
开发语言·前端·javascript·计算机外设
bubusa~>_<31 分钟前
解决npm install 出现error,比如:ERR_SSL_CIPHER_OPERATION_FAILED
前端·npm·node.js
yanglamei196244 分钟前
基于Python+Django+Vue的旅游景区推荐系统系统设计与实现源代码+数据库+使用说明
vue.js·python·django
[廾匸]1 小时前
cesium视频投影
javascript·无人机·cesium·cesium.js·视频投影
流烟默1 小时前
vue和微信小程序处理markdown格式数据
前端·vue.js·微信小程序
梨落秋溪、1 小时前
输入框元素覆盖冲突
java·服务器·前端
菲力蒲LY2 小时前
vue 手写分页
前端·javascript·vue.js
一丢丢@zml2 小时前
new 一个构造函数的过程以及手写 new
javascript·手写new
天下皆白_唯我独黑2 小时前
npm 安装扩展遇到证书失效解决方案
前端·npm·node.js