Skip to content

feat(prefer-template): ignore style block #2737

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

Closed
wants to merge 1 commit into from
Closed

Conversation

waynzh
Copy link
Member

@waynzh waynzh commented Apr 15, 2025

fix #2712

Copy link
Member

@FloEdelmann FloEdelmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. But I'm curious why the erroneous behavior was actually covered by a test case 🤔
Was it intentional?

@waynzh
Copy link
Member Author

waynzh commented Apr 15, 2025

Ah, I found that the original test case behavior is correct though.
The v-bind in CSS must be wrapped in quotes. So the user's issue should be resolved by changing width: v-bind(someWidth + 'px'); to width: v-bind("someWidth + 'px'");.
Then, the autofix will correct it to v-bind("`${someWidth}px`"), which should then be right.

@waynzh
Copy link
Member Author

waynzh commented Apr 15, 2025

I'm going to close this PR for now and will further elaborate in the issue discussion.

@waynzh waynzh closed this Apr 15, 2025
@FloEdelmann FloEdelmann deleted the ignore-style branch April 15, 2025 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

vue/prefer-template tries to apply to style scoped
2 participants