I want to to add and remove the style pointer-events:none; attribute dynamically with Vue.js:
new Vue({
el: '#el',
data: {
toggled: false
},
methods: {
toggle: function () {
this.toggled = !this.toggled;
},
}
})
<script src="https://cdn.jsdelivr.net/npm/vue"></script>
<div id="el">
<!-- The style disables all mouse events in the div -->
<div style="pointer-events:none;">
...
</div>
<button v-on:click="toggle">Toggle click</button>
</div>
How should I do this?