标签:eth htm script bsp 前端 UNC 内容 app var
<html> <title>test</title> <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script> <style> .activated{ color: red } </style> <body><div id="app" @click="hanleddivclick" :class="{activated:isactivated}"> hello word </div> <script> var vm = new Vue({ el:"#app", data:{ isactivated:false }, methods:{ hanleddivclick:function(){ this.isactivated = !this.isactivated; } } }) </script> </body> </html>
【前端】【vue 3-6】点击文本内容,根据点击,切换class属性
标签:eth htm script bsp 前端 UNC 内容 app var
原文地址:https://www.cnblogs.com/stevenlii/p/9159714.html