Answers for "vue mouseover"

0

vue mouseover

<template>
  <div
    @mouseover="hover = true"
    @mouseleave="hover = false"
  />
</template>
Posted by: Guest on June-04-2021
0

vue mouseover

<style>
		.pink {
            background-color: pink;
        }
        .branco {
            background-color: white;
        }
</style>
<body>

	<div id="app">
    	<div 
            class="borda div-comum" 
            @mouseover="mudarCor('pink')" 
            @mouseleave="mudarCor('branco')">
        </div>
   	</div>
    
    <script>

        options = {
            el: '#app',
            data: {
                cor: ''
            },
            methods: {
                mudarCor(c) {
                    this.cor = c;
                    console.log(c);
                    console.log('Cor : ' , this.cor);
                }
            },
        }
        const vm = new Vue(options);
        console.log(vm);

    </script>
    
</body>
Posted by: Guest on September-06-2021

Browse Popular Code Answers by Language