-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Vue / Knobs - optimize on force render #4773
Merged
Merged
Changes from 4 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
3861875
Update simple knob example to have inner state and knobs passed with …
igor-dv 94e200b
Fix typo
igor-dv 2559c8c
Add updateComponent function that will forceUpdate the last story ins…
igor-dv c415275
Update snapshot
igor-dv d9e2de5
Merge remote-tracking branch 'origin/next' into vue-knobs-optimize-on…
igor-dv 0ab99ea
defining typical use-case
y-nk 67cfcdd
modified render function to focus on Vue props
y-nk 2dc1ca2
extend refresh behavior to the whole component
y-nk e2af7b8
Fix snapshot
igor-dv 4d37d30
Fix the bug. There are cases where props are not defined
igor-dv 69776c4
Extract methods
igor-dv 1128c34
Fix linter
igor-dv 2ac83dd
Remove tmp ignore
igor-dv File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
examples/vue-kitchen-sink/src/stories/SimpleKnobExample.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<template> | ||
<div @click="i++">I am {{ name }} and I'm {{ age }} years old. Inner State Counter {{ i }}</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
props: { | ||
name: String, | ||
age: Number, | ||
}, | ||
data() { | ||
return { | ||
i: 40, | ||
}; | ||
}, | ||
created() { | ||
console.log('created'); | ||
}, | ||
destroyed() { | ||
console.log('destroyed'); | ||
}, | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I don't believe this will be necessary since Vue as observers for all values of component internal states ; but that won't kill performances either for most of the case, so it's ok to leave it if you feel it's safer.