diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js index ce13428..7e4e00f 100644 --- a/build/webpack.prod.conf.js +++ b/build/webpack.prod.conf.js @@ -14,11 +14,6 @@ module.exports = merge(baseWebpackConfig, { minimizer: [ new TerserPlugin({ sourceMap: true, - terserOptions: { - compress: { - drop_console: true, - }, - }, }), ], } diff --git a/docs/.vuepress/components/LoopedSelect.vue b/docs/.vuepress/components/LoopedSelect.vue new file mode 100644 index 0000000..75c29b1 --- /dev/null +++ b/docs/.vuepress/components/LoopedSelect.vue @@ -0,0 +1,43 @@ + + + + + diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index d8d80e0..583ba3d 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -114,12 +114,13 @@ module.exports = { ], }, { - title: 'Digging Deeper', + title: 'Use Cases', collapsable: false, children: [ ['guide/validation', 'Validation'], ['guide/vuex', 'Vuex'], ['guide/ajax', 'AJAX'], + ['guide/loops', 'Using in Loops'], ], }, { diff --git a/docs/guide/css.md b/docs/guide/css.md index 8c16a1c..20f28e5 100644 --- a/docs/guide/css.md +++ b/docs/guide/css.md @@ -34,4 +34,25 @@ all instances of Vue Select, or add your own classname if you just want to affec <<< @/.vuepress/components/CssSpecificity.vue +## Dropdown Transition +By default, the dropdown transitions with a `.15s` cubic-bezier opacity fade in/out. The component +uses the [VueJS transition system](https://vuejs.org/v2/guide/transitions.html). By default, the + transition name is `vs__fade`. There's a couple ways to override or change this transition. + +1. Use the `transition` prop. Applying this prop will change the name of the animation classes and +negate the default CSS. If you want to remove it entirely, you can set it to an empty string. + +```html + +``` + +2. You can also override the default CSS for the `vs__fade` transition. Again, if you +wanted to eliminate the transition entirely: + +```css +.vs__fade-enter-active, +.vs__fade-leave-active { + transition: none; +} +``` diff --git a/docs/guide/loops.md b/docs/guide/loops.md new file mode 100644 index 0000000..9c7e223 --- /dev/null +++ b/docs/guide/loops.md @@ -0,0 +1,17 @@ +### Using Vue Select in v-for Loops +--- + +There may be times that you are including Vue Select within loops of data, such as a table. This can +pose some challenges when emitting events from the component, as you won't know which Vue Select +instance emitted it. This can make it difficult to wire up with things like Vuex. + +Fortunately, you can solve this problem with an anonymous function. The example below doesn't use +Vuex just to keep things succinct, but the same solution would apply. The `@input` is handled +with an inline anonymous function, allowing the selected country to be passed to the `updateCountry` +method with the `country` and the `person` object. + + + +<<< @/.vuepress/components/LoopedSelect.vue + + diff --git a/docs/guide/slots.md b/docs/guide/slots.md index 10d3c50..7bfe9b1 100644 --- a/docs/guide/slots.md +++ b/docs/guide/slots.md @@ -10,14 +10,13 @@ vue-select provides the scoped `option` slot in order to create custom dropdown ```html -