os-window-vue v0.4.1
OS-Window Vue Component
A Vue wrapper around os-window which provides support for Vue events and properties.
Getting started
Choose any of the following methods to get started. You also need to install the actual os-window library.
Install via node package manager
Run the following command in your command line to add both os-window and os-window-vue to your project
# for NPM
> npm install --save os-window os-window-vue
# for YARN
> yarn add os-window os-window-vue
Including the base library
In your application entrypoint you need to include the library os-window
. Afterwards you can use the vue component as shown in the example section:
import 'os-window';
Inclusion in the Browser
You can also directly include the JavaScript module in the browser with the browser.js
entrypoint:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script type="module" src="node_modules/vue/dist/vue.js"></script>
<script type="module" src="node_modules/os-window/main.js"></script>
<script type="module" src="node_modules/os-window-vue/browser.js"></script>
</head>
<body>
<div id="app">
<os-window-vue
window-title="Random Cat Pic"
>
<img src="https://placekitten.com/250/250">
</os-window-vue>
</div>
<script type="module">
new Vue({
components: {
osWindowVue: window.OsWindowVue,
},
el: '#app',
});
</script>
</body>
</html>
Use the CDN
This project is also published to the CDN unpkg, which enables you to skip any local module installation when including this module in your webpage. Don't forget to also include os-window
, which is also provided by unpkg:
<!-- Include specific version (recommended) -->
<script type="module" src="https://unpkg.com/os-window@0.3.1"></script>
<script type="module" src="https://unpkg.com/os-window-vue@0.1.6/browser.js"></script>
<!-- Include latest version (not recommended) -->
<script type="module" src="https://unpkg.com/os-window"></script>
<script type="module" src="https://unpkg.com/os-window-vue/browser.js"></script>
For more information have a look at the Installation Guide or the detailled documentation.
Demo
Try the latest version of os-window-vue online at https://bit.ly/2xXWUYg!
Examples
This example creates a non-interactive window with light macos theme
<template>
<os-window-vue
:window-title="'Random Cat Pic'"
>
<img src="https://placekitten.com/250/250">
</os-window-vue>
</template>
<script>
import OsWindowVue from 'os-window-vue';
export default {
components: {
OsWindowVue,
},
};
</script>
The next example creates a fully interactive window with dark macos theme
<template>
<os-window-vue
:hover="true"
:interactive="true"
:os-theme="'mac'"
:theme="'dark'"
:window-state="'maximized'"
:window-title="'Random Cat Pic'"
>
<img src="https://placekitten.com/250/250">
</os-window-vue>
</template>
<script>
import OsWindowVue from 'os-window-vue';
export default {
components: {
OsWindowVue,
},
};
</script>
Requirements
- os-window: Ver. >= 0.2.0
- Vue: Ver. >= 2.0.0
- Browsers:
- IE: not supported
- Edge: Ver. >= 80
- Firefox: Ver. >= 63
- Chrome: Ver. >= 67
- Safari: Ver. >= 10.1
- Opera: Ver >= 41
Documentation
Find more detailed information in the documentation.
Contributing
If you have any ideas, just open an issue and tell me what you think.
If you find any bugs, just open an issue and let me know. Or go right ahead and create a pull request.
If you'd like to contribute, please fork the repository and make changes as you'd like. Pull requests are warmly welcome.
Licensing
This project is licensed under MIT license. You'll find a copy of the MIT license in the file LICENSE.