New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fallthrough attributes not recognized since 1.0.3 #1986
Comments
Just one of the ways, but you can try: <template>
<li class="nav-item">
<router-link v-bind="$attrs" class="nav-link">
<slot />
</router-link>
</li>
</template>
<script lang="ts">
import { RouterLink } from 'vue-router';
export default {
inheritAttrs: false,
} as unknown as new () => {
$props: InstanceType<typeof RouterLink>['$props'],
$attrs: any,
};
</script> |
Okay, it does work but it feels a bit complex. Is this the recommended way to do fallthrough attributes? |
It can be simplify. <script lang="ts">
import { DefineComponent } from 'vue';
import { RouterLink } from 'vue-router';
export default {
inheritAttrs: false,
} as typeof RouterLink & DefineComponent;
</script>
It just a workaround from me. I don't know what is the community consensus. You can try ask in TypeScript channel of Vue discord server. |
any better solution? |
This seems like a serious impediment to quality |
@voidus A lot of work is required to perform static analysis. I will look into this. |
Oh I just see you can use |
Hey! I have this wrapper component:
(very standard way of doing a wrapper attribute as described in vue's docs). I'm calling it like this:
So I am passing the
to
property. Andvue-tsc
gives me this error since upgrading to 1.0.3:It did not give me this error on 0.40.0. I did look at #1384 but I don't think it's the same issue, since it worked fine in 0.40.0.
Is there something else I should do after upgrading to 1.0.x to enable support for fallthrough attributes?
The text was updated successfully, but these errors were encountered: