Skip to content
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

docs: fix update theme property to a reactive property #2750

Merged
merged 2 commits into from Apr 25, 2024

Conversation

GmavionR
Copy link
Contributor

Update theme to reactive property

Description of Problem

Theme should be a reactive property before you can use v-bind in css.

Proposed Solution

Additional Information

Update theme to reactive  property
Copy link

netlify bot commented Mar 14, 2024

Deploy Preview for vuejs ready!

Name Link
🔨 Latest commit 56c319f
🔍 Latest deploy log https://app.netlify.com/sites/vuejs/deploys/662acf91aae7b00008764979
😎 Deploy Preview https://deploy-preview-2750--vuejs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@AloisSeckar
Copy link
Contributor

Hello, and thank you for your interest in improving Vue.js docs. But your assumption is wrong. Static values can be bound easilly - see live demo here.

Using reactive would become useful to allow dynamic runtime changes of the bound color. But this is not what this simple demo is focusing at, so I think it would be rather confusing than helpful to include it here.

@brc-dd
Copy link
Member

brc-dd commented Mar 14, 2024

I think having reactive will be more consistent with the options API example above it, and the description below that states that the styles are reactively updated if the source value changes. We can probably make the example more useful than just keeping it simple because I don't think any one would use CSS data binding for a static value.

PS: remove extra ref import

Copy link
Member

@bencodezen bencodezen left a comment

Choose a reason for hiding this comment

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

Great catch @GmavionR! I modified the example you submitted down to only import ref and use that instead of reactive since this is the one we'd like to see the community standardize on if possible.

Thank you for the PR!

@bencodezen bencodezen merged commit 90e33ea into vuejs:main Apr 25, 2024
4 of 5 checks passed
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.

None yet

4 participants