6vue分支循环

分支v-if

<!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>Document</title>
    <style>
        .active {
            border:1px solid red;
            width:100px;
            height:100px;
        }
        .error {
            background-color: orange;
        }
    </style>
</head>
<body>
    <div id = "app1">
        <div v-if='score>=90'>优秀</div>
        <div v-else-if='score<90&&score>=80'>良好</div>
        <div v-else-if='score<80&&score>=70'>一般</div>
        <div v-else='score<70'></div>
    </div>
    <script src="vue.js"></script>
    <script>
        var vue1 = new Vue({
            el: '#app1',
            data:{
                score:88
            },
            methods:{
                
            }
        })
    </script>
</body>
</html>
原文地址:https://www.cnblogs.com/gao-chao/p/13416007.html