container-query icon indicating copy to clipboard operation
container-query copied to clipboard

Vue Example

Open eulertour opened this issue 5 years ago • 1 comments

I couldn't figure out how to make this work with a vue (vue-cli) project. An example in the documentation would be extremely helpful.

eulertour avatar Feb 28 '20 10:02 eulertour

Unfortunately I don't use vue, so not entirely sure how React's lifecycle methods translate there. It shouldn't be too hard though, all you need to do is to create a Container instance when a vue component "mounted" with the actual dom element. For react the key is componentDidMount: https://github.com/ZeeCoder/container-query/blob/master/packages/react-container-query/src/ContainerQuery.js

The hook version would be even simpler, I just never got around to finish it: https://github.com/ZeeCoder/container-query/commit/18dd21e11aa57e43b64f159621409eb9e0c6cf72#diff-ff42a97c4f3571a1d6e2a2652d6be6fa

ZeeCoder avatar Feb 28 '20 12:02 ZeeCoder