npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vue3-resizable

v1.0.0-alpha.3

Published

Vue3 is used for components with resizable and draggable elements.

Downloads

72

Readme

🐳 Vue 3 Composition API

🔥 Written in TypeScript

English · 简体中文 · Demo/Document

Installation

Install using npm:

npm install vue3-resizable

Install using pnpm:

pnpm install vue3-resizable

Or using yarn:

yarn add vue3-resizable

Usage

First, ensure that you import the component in your Vue project:

Global Import

import { createApp } from "vue"
import App from "./App.vue"

import LResize from "vue3-resizable"
import "vue3-resizable/dist/index.css"

const app = createApp(App)
app.use(LResize)
app.mount("#app")

Local Import

import { LResize } from "vue3-resizable"
import "vue3-resizable/dist/index.css"

Then, use it in your component:

<template>
  <LResize
    :minWidth="100"
    :minHeight="100"
    :maxWidth="300"
    :maxHeight="300"
    :initialWidth="150"
    :initialHeight="150"
    :initialTop="50"
    :initialLeft="50"
    :cssUnit="'px'"
    :showDimension="true"
    :showPosition="true"
  >
    <!-- You can insert any custom content here -->
    <div>Resizable content container</div>
  </LResize>
</template>

Props

| Prop | 类型 | 默认值 | 描述 | | --------------- | ------------------------- | ------- | -------------------- | | minWidth | number | 30 | Minimum width limit | | minHeight | number | 30 | Minimum height limit | | maxWidth | number | none | Maximum width limit | | maxHeight | number | none | Maximum height limit | | initialWidth | number | 200 | Initial width | | initialHeight | number | 200 | Initial height | | initialTop | number | 100 | Initial top offset | | initialLeft | number | 100 | Initial left offset | | cssUnit | 'px' \| 'rem' \| string | 'px' | Size unit | | showDimension | boolean | false | Show size info | | showPosition | boolean | false | Show position info | | style | CSSProperties | {} | Container style | | handleStyle | CSSProperties | {} | Drag handle style |

Slots

| Slot Name | Description | | --------- | --------------------- | | default | Insert custom content |

Events

| Event Name | Description | Parameters | | ---------- | -------------------------------------------------- | ---------- | | boxUpdated | Triggered when the box size or position is updated | BoxState |

BoxState Parameters

| Parameter Name | Type | Description | | -------------- | -------- | ------------------------ | | width | number | Width of the box | | height | number | Height of the box | | top | number | Top position of the box | | left | number | Left position of the box | | zIndex | number | z-index value of the box |

Exposes

| Method Name | Description | Parameters | | -------------- | ---------------- | ------------ | | updateBoxStyle | Update box style | () => void | | startDrag | Start dragging | () => void | | endDrag | End dragging | () => void | | startResize | Start resizing | () => void | | endResize | End resizing | () => void |

Developer Guide

To contribute to the development of this component, you can clone the source code repository and install all dependencies:

git clone https://github.com/LostElkByte/vue3-resizable.git
cd vue3-resizable
npm install

Contribution

Contributions are welcome through Issues or Pull Requests. Please ensure your code follows the project's style and quality standards.

License

This project is licensed under the MIT License. For more information, please see the LICENSE file.