2022-10-19 10:20阅读: 20评论: 0推荐: 0

条件指令

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="vue.js"></script>
</head>
<body>
    <div id="app">
        <h2># 指令:实现符合某个条件,就显示某个标签</h2>
        <!-- v-if  v-else-if   v-else-->

        <p v-if="scores>90">1</p>
        <p v-else-if="scores<90 && scores>70">2</p>
        <p v-else="scores<70">3</p>
    </div>
</body>
<script>
    const app = Vue.createApp(
        {
            data(){
                return{
                    scores:70
                }
            },
            methods:{

            }
        }
    )
    app.mount("#app")
</script>
</html>

本文作者:Sherwin

本文链接:https://www.cnblogs.com/sherwin1995/p/16805311.html

版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 2.5 中国大陆许可协议进行许可。

posted @   Sherwin_szw  阅读(20)  评论(0编辑  收藏  举报
点击右上角即可分享
微信分享提示
💬
评论
📌
收藏
💗
关注
👍
推荐
🚀
回顶
收起
  1. 1 404 not found REOL
404 not found - REOL
00:00 / 00:00
An audio error has occurred.