Display your app in a device sized window. Perfect for sharing with clients.
The window is ignored on mobile and tablet devices, including Chrome/Safari Developer Tools
https://normally.github.io/vue-device/
yarn add vue-device
importdevicefrom'vue-device'exportdefault{components: {
device
},
...
}After that, wrap your app in the device tag:
<device><app/></device>- npm or yarn install the 'vue-device' .
- create a new file in plugins folder as
vue-device.js - Add this to the file and register the component
importVuefrom'vue';importDevicefrom'vue-device';Vue.component(Device.name,Device)
- Then in the
nuxt.config.jsaddplugins: [{src: '~/plugins/vue-device.js',ssr: false}],
- Wrap the
<nuxt/>tag in like
<device><nuxt/></device>| Property | Default | Description |
|---|---|---|
type | iPhone8 | Can be any of the available devices |
background | #FFF | Background color |
landscape | false | Display the window in landscape mode |
picker | false | Show device picker above frame |
autoscale | true | Always fit the device in the browser window and scale the content |
border | false | Show a black border around the device |
disabled | false | Disable altogether just as a desktop view |
<devicetype='iPhone8' background='#444' autoscale='false' landscapepickerborder> ... </device>- Nic Mulvaney - Normally