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

V3 - Remove mutable class properties plus other misc changes #781

Merged
merged 16 commits into from Mar 23, 2019

Conversation

owenconti
Copy link
Contributor

@owenconti owenconti commented Mar 5, 2019

Lot's of stuff here, apologies for the large size. I can break pieces out to individual PRs if needed.

I'll try to summarize the changes:

Select component

  • Remove mutableValue and mutableOptions in hopes of simpler and less code in Select.vue
  • Added two new computed properties which take the place of mutableValue and mutableOptions: selectedValue and optionList
  • selectedValue is always an array (regardless of the multiple prop). This makes working with it easier because we'll always know the type
  • optionList is the combination of the options prop plus any pushed tags

Tests:

  • I've updated all the tests to pass. However, because we no longer mutate an internal prop when a value is passed, most of the tests were updated to not pass a value prop. By not passing a value prop, vue-select knows it has to manage the selected value internally. There is an internalValue data value which is used to manage the internal value (very much like mutableValue was before, only internalValue is only used in two places)
  • Removed the unused karma test

Dev sandbox:

  • I've added two more example usages of vue-select to the sandbox. I wanted to have examples of the three ways you can pass the selected value to the component: v-model, :value with @input, and no value (managed internally).

screen shot 2019-03-04 at 11 27 44 pm

src/components/Select.vue Outdated Show resolved Hide resolved
src/components/Select.vue Outdated Show resolved Hide resolved
Copy link
Contributor Author

@owenconti owenconti left a comment

Choose a reason for hiding this comment

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

Removed the onInput prop and replaced with a method: updateValue

src/components/Select.vue Outdated Show resolved Hide resolved
src/components/Select.vue Outdated Show resolved Hide resolved
build/webpack.prod.conf.js Show resolved Hide resolved
src/components/Select.vue Outdated Show resolved Hide resolved
@sagalbot sagalbot merged commit f972591 into sagalbot:release/v3.0 Mar 23, 2019
@sagalbot
Copy link
Owner

Huge thanks for this one @owenconti I think it's a big improvement!

@sagalbot sagalbot mentioned this pull request Apr 3, 2019
sagalbot added a commit that referenced this pull request Apr 14, 2019
* origin/release/v3.0: (67 commits)
  ensure #222 stays closed (#828)
  add guide for reduce and taggable (#827)
  Remove foo bar (#826)
  WIP: v3 – remove onSearch callback prop (#811)
  doc content updates
  overhaul selecting docs, updated navigation and URL structure
  bump vue-server-renderer (#807)
  WIP: V3 - Remove index prop, add reduce prop (#800)
  V3/update list items slot (#799)
  update vuepress (#797)
  Update sandbox
  Add patch from #787
  update package deps, remove extra dev options
  V3 - Remove `mutable` class properties plus other misc changes (#781)
  refactor deselect method (#768)
  Sass & Class Renames (#759)
  fix coveralls coverage reporter (#766)
  remove: - express - gitbook - json-loader - markdown-loader - normalize.css - prismjs - vue-resource
  use test-utils beta-20
  fix failing test
  ...

# Conflicts:
#	docs/gitbook/README.md
#	docs/homepage/home.html
#	src/components/Select.vue
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

2 participants