Skip to content

Repository files navigation

vue-device

npmnpmvue2

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

Demo

https://normally.github.io/vue-device/

Install

yarn add vue-device

Usage

Vuejs

importdevicefrom'vue-device'exportdefault{components: {
device
},
...
}

After that, wrap your app in the device tag:

<device><app/></device>

Nuxtjs

  1. npm or yarn install the 'vue-device' .
  2. create a new file in plugins folder as vue-device.js
  3. Add this to the file and register the component
    importVuefrom'vue';importDevicefrom'vue-device';Vue.component(Device.name,Device)
  4. Then in the nuxt.config.js add
    plugins: [{src: '~/plugins/vue-device.js',ssr: false}],
  5. Wrap the <nuxt/> tag in like
<device><nuxt/></device>

Options

PropertyDefaultDescription
typeiPhone8Can be any of the available devices
background#FFFBackground color
landscapefalseDisplay the window in landscape mode
pickerfalseShow device picker above frame
autoscaletrueAlways fit the device in the browser window and scale the content
borderfalseShow a black border around the device
disabledfalseDisable altogether just as a desktop view
Example:
<devicetype='iPhone8' background='#444' autoscale='false' landscapepickerborder> ... </device>

Authors

About

Display your app in a device sized window. Perfect for sharing with clients.

Resources

Stars

8 stars

Watchers

4 watching

Forks

Releases

Packages

Used by

Contributors

Languages