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
⚡ improvement(interpolation): enable passage of local components to tag prop #928
Conversation
Thank you for your PR!
The current specifications of In about this PR, We need your more detail explanation and use-case. |
Yeah sure, I was motivated to do this, because on the company I work for, we have a text component (to standardize text styles between various projects), when this text component is not a global component I can't use it with Currently on vue-i18n@8.x I can't do this: <template>
<i18n :tag="$options.UiText" path="a.path" />
</template>
<script>
import UiText from 'file'
export default {
UiText,
}
</script> This PR makes ⬆️ that example work. A.K.A.: This PR makes i18n be able to render locally imported components instead of only global ones 😄 Alternatively, on the current live version, one would have to do the following to achieve the same result: <template>
<UiText>
<i18n :tag="false" path="a.path" />
</UiText>
</template>
<script>
import UiText from 'file'
export default {
components: { UiText },
}
</script> |
Thank you for your explanation! We need unit test for this feature and should change branch to Could you update this PR, please? |
Sure, will do this later today :D |
Codecov Report
@@ Coverage Diff @@
## v8.x #928 +/- ##
=======================================
Coverage 96.42% 96.42%
=======================================
Files 10 10
Lines 896 896
=======================================
Hits 864 864
Misses 32 32
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
LGTM! 👍
This should enable the user to, not only pass global components and html tags, but also locally imported components.
Of note: I commited this changes directly on github web interface. So I didn't write tests or any lint on commit, I did so because I want to just test the ideia with the community/mantainers, if you like the idea I'm more than willing to fix any mistakes I may have commited.