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"> <h2>Vue js window.location.protocol Property </h2> <p>Get current web protocol from URL in Vue Js</p> <button @click="myFunction">Get Protocol</button> <p>{{currentProtocol}}</p> </div> <script type="module"> import { createApp } from 'vue' createApp({ data() { return{ currentProtocol:'', } }, methods:{ myFunction(){ this.currentProtocol ='Current Protocol: '+ window.location.protocol; }, } }).mount('#app') </script> </body> </head> </html>