privatenumber / vue-proxi Goto Github PK
View Code? Open in Web Editor NEW๐ Tiny proxy component for Vue.js
License: MIT License
๐ Tiny proxy component for Vue.js
License: MIT License
This is a comparison between Reactive Provide and Proxi to outline differences in purpose and how one is not necessarily an alternative to the other.
Reactive Provide 0.3.0 | Proxi 1.0.0-beta.1 | |
---|---|---|
Purpose | To provide a reactive object given a list of properties from the Parent VM | To proxy data applied to the <proxi> to a targeted Child component instance |
Uses provide/inject | โ | โ |
Has template API | โ | โ
Founded on the idea that component communication should remain in the template instead of re-invented |
Passes down attrs , props , listeners attached to the Parent |
โ | โ๏ธ Not primariy use-case but possible with <proxi v-bind="{ ...$props, ...$attrs}" v-on="$listeners"> |
Parent can bind arbitrary class , attrs , props , listeners to the Child |
โ You can pass down any property from Parent VM but won't be bound |
โ
listeners and props automatically bound to Child, class available in this.$$.class , attrs available in this.$$.attrs |
Child can pass down injected attrs and listeners |
โ The injected data is merged into a single object. Would require filteration |
โ๏ธ v-bind="$$.attrs" v-on="$$.listeners" |
Dependents | ||
Install size | ||
Bundle size |
I see typescript errors when trying to use the injected props in my child component. Typescript is unable to find these injections. The code renders locally, but these typescript errors break the build of my application.
I would like to be able to access my props directly this.myProp
or through some const to make it clear that it's injected like this.ProxiInjection.myProp
without any typescript errors
You can explore a reproduction of this error here: https://codesandbox.io/s/vue-typescript-example-forked-x4h98x?file=/src/App.vue
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.