Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

A Vue wrapper component for WinBox.js.

License

NotificationsYou must be signed in to change notification settings

wobsoriano/vue-winbox

Repository files navigation

Vue 3 wrapper forWinBox.js.

Demo:https://vue-winbox.vercel.app

Install

pnpm add vue-winbox

Usage

<scriptsetup>import{ref}from'vue'import{VueWinBox}from'vue-winbox'constcount=ref(0)constwbRef=ref()//WinBox optionsconstoptions={title:'Current count: 0',class:'modern',}setInterval(()=>{count.value++wbRef.value?.winbox?.setTitle(`Current count:${count.value}`)},500)</script><template><VueWinBoxref="wbRef":options="options"@onmove="onMove"><div>Window 1: {{ count }}</div></VueWinBox></template>

Methods

To update props and access methods/controls, just add aref to theVueWinBox component and use it like how you would withWinBox.js:

// Set the window titlewbRef.value.winbox.setTitle('New title')// Custom Position / SizewbRef.value.winbox.resize('50%','50%').move('center','center')// Add classwbRef.value.winbox.addClass('modern')// Focus a window (bring up to front)wbRef.value.winbox.focus()// Chaining MethodswbRef.value.winbox.setTitle('Title').resize('50%','50%').move('center','center').focus()

To reinitialize a closed window:

wbRef.value.winbox.initialize()

Events

NameTypeDefaultDescription
resizeFunction-Fired when the window resizes.
closeFunction-Fired when the window is closing.
focusFunction-Fired when the window is in focus.
blurFunction--
moveFunction-Fired when the window moves.

Vanilla WinBox.js

import{useWinBox}from'vue-winbox'constcreateWindow=useWinBox()functiongenerate(){constwinbox=createWindow({title:'Window title',})winbox.fullscreen()}

License

MIT


[8]ページ先頭

©2009-2025 Movatter.jp