Coder Social home page Coder Social logo

vue-resize's Introduction

vue-resize's People

Contributors

akryum avatar jrgleason avatar rocka avatar tibineagu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vue-resize's Issues

typescript support

HI, good work.

Just a request, would it be possible to add the types to be able to use it with typescript?

Set CSS class instead of inline style

The component causes a CSP error if unsafe-inline is not declared in a defined style-src directive, moving the inline style applied to the object into a CSS class would solve the issue.

Occasional redundant resize notifications

At this line in ResizeObserver.vue, the notify event is being emitted for every detected "resize" of the _resizeObject.

However, in some situations, if you debug the values of this.$el.offsetWidth and this.$el.offsetHeight, they are the same across all the occurrences of the resize event (which leads me to think that they're likely caused by sub-pixel varations in the height of the object).

This is related to this issue in vue-virtual-scroller where the redundant notifications generate an infinite loop of height recalculations in the DynamicScroller component.

I think the correct behaviour should be to only trigger the resize notification if the calculated dimensions of the wrapper element have also changed.


EDIT: Opened PR #8 for this

PopoverResize seems not to respect Page-Size

Hey Akryum,

we use your popover-library meanwhile on Nextcloud-vue-lib. Through this, we use a popover as a menu on nextcloud-forms-app.
We now recognized a strange behaviour where the popover is not aligned, where it should be. I'm not completely sure, but to me this seems, as beeing a bug in the PopoverResize-position-calculation - or then down here on vue-resize? Unfortunately i didn't find the exact place. The values applied by translate3d just seem not to respect the page-size, but only the current window-size.
Do you know where to look into here or where to fix this?

Greets :)
Jonas

popoverresize
popoverresize2

Cannot import the module

I wanted to try this plugin but unfortunately I couldn't import the module in my project.

If I run:

import Vue from 'vue'
import app from './app.vue'
import VueResize from 'vue-resize'

Vue.use(VueResize)

new Vue({
  el: '#app',
  render: h => h(app)
})

I get:

Module parse failed: /Users/ts/Work/vue-resize-test/node_modules/vue-resize/index.js Unexpected token (1:20)
You may need an appropriate loader to handle this file type.
| export default from './dist/vue-resize'
| export * from './dist/vue-resize'
| import './dist/vue-resize.css'

 @ ./index.js 3:0-35
 @ multi (webpack)-hot-middleware/client.js?reload=true index.js

> Open http://localhost:4000

Limit size direction.

It would be nice to be able to limit the sizing direction. Horizontal and/or Vertical for example.

Event on mount

Thank you for your component! I've implemented an automatic size switch with it. However, I had to manually add a mounted() hook to determine the initial size.

mounted(): void {
   this.handleResize({
      width: (this.$el as HTMLElement).offsetWidth,
      height: (this.$el as HTMLElement).offsetHeight
   });
},

Would you be interested in me submitting a PR to add a property to also fire an event on mount? I'm thinking about appear, just like Vue's <transition />.

Browser support?

Hi,

If its using ResizeObserver, I wonder whats the browser support? Does it work in IE11?

Stylus dependency causes warning on node 14

The stylus dependency referenced by the demo app in this package causes these warnings with node 14:

(node:16968) Warning: Accessing non-existent property 'lineno' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
(node:16968) Warning: Accessing non-existent property 'column' of module exports inside circular dependency
(node:16968) Warning: Accessing non-existent property 'filename' of module exports inside circular dependency
(node:16968) Warning: Accessing non-existent property 'lineno' of module exports inside circular dependency
(node:16968) Warning: Accessing non-existent property 'column' of module exports inside circular dependency
(node:16968) Warning: Accessing non-existent property 'filename' of module exports inside circular dependency

New width and height in event

Hello, couldn't it be useful to have the new width/height as parameters of the notify event ?

handleResize: function(evt) {
    console.log("new size is " + evt.width + "x" + evt.height);
}

(even if these dimensions can be retrieved with a call to offsetWidth or similar property).

GET "http://hostname/null" vue-resize.esm.js:73

Hi.
Sometimes i see this error in console:

GET "http://mysitehostname/null" 404 (Not Found) vue-resize.esm.js:73
var object = document.createElement('object');
this._resizeObject = object;
object.setAttribute('aria-hidden', 'true'); // <---- line 73
object.setAttribute('tabindex', -1);
object.onload = this.addResizeHandlers;
object.type = 'text/html';

Chrome 75.0.3770.80 (x64, Linux)

How to install in vue 3

I m upgrading my version 2 Vue project to Vue 3, and this plugin does not work in Vue 3.
How can I fix it

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.