screen_rotation
Copied to Clipboard
<html> <head> <script type="importmap"> { "imports": { "vue": "https://unpkg.com/vue@3/dist/vue.esm-browser.js" } } </script> <body> <div id="app"> <h3>Vue Js Toggle Button</h3> <button @click="toggle">{{ text }}</button> </div> <script type="module"> import { createApp } from "vue"; createApp({ data() { return { isActive: false, } }, computed: { text() { return this.isActive ? 'ON' : 'OFF'; }, }, methods: { toggle() { this.isActive = !this.isActive; }, }, }).mount("#app"); </script> </body> </head> </html>