Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

v3-resize

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

v3-resize

适用于 Vue 3.0 的计算元素实时宽高的指令。

  • 1.0.5
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source
v3-resize

适用于 Vue 3.0 的计算元素实时宽高的指令。

安装

$ npm i -S v3-resize

使用

hooks 方式
<template>
  <div id="resize">
    拖拽获取实时尺寸
  </div>
</template>

<script setup>
import { onMounted } from 'vue'
import useResize from 'v3-resize'
onMounted(() => {
  useResize(document.querySelector('#resize'), (e) => {
    console.log(e)
  })
})
</script>

<style lang="scss" scoped>
#resize {
  border: 1px solid #ccc;
  resize: both;
  overflow: hidden;
}
</style>
指令方式
<template>
  <div id="resize" v-resize="resize">
    拖拽获取实时尺寸
  </div>
</template>

<script setup>
const resize = (e) => {
  console.log(e)
}
</script>

<style lang="scss" scoped>
#resize {
  border: 1px solid #ccc;
  resize: both;
  overflow: hidden;
}
</style>

main.js

import useResize from 'v3-resize'

app.use(useResize).mount('#app')

Keywords

FAQs

Package last updated on 07 Oct 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc