From b684cf1a6e606c28ef8d65d40c5fed495be58178 Mon Sep 17 00:00:00 2001 From: Jeff Sagal Date: Wed, 6 Nov 2019 14:56:25 -0800 Subject: [PATCH 1/3] add prepare (#980) --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index a194899..deefd80 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "private": false, "main": "dist/vue-select.js", "license": "MIT", + "prepare": "npm run build", "scripts": { "serve": "webpack-dev-server --config build/webpack.dev.conf.js --hot --progress -d", "serve:docs": "cd docs && yarn serve", From 0a589704f8dcfc29f3bcd9394549ef00b5385e86 Mon Sep 17 00:00:00 2001 From: Jeff Sagal Date: Thu, 7 Nov 2019 18:15:41 -0800 Subject: [PATCH 2/3] add v-for docs (#982) --- docs/.vuepress/components/LoopedSelect.vue | 43 ++++++++++++++++++++++ docs/.vuepress/config.js | 3 +- docs/guide/loops.md | 17 +++++++++ 3 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 docs/.vuepress/components/LoopedSelect.vue create mode 100644 docs/guide/loops.md 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/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 + + From e7103fc5bd0c267cfd71dbdec0baf213d8e1da3f Mon Sep 17 00:00:00 2001 From: Jeff Date: Thu, 7 Nov 2019 19:33:23 -0800 Subject: [PATCH 3/3] don't drop console when minify --- build/webpack.prod.conf.js | 5 ----- 1 file changed, 5 deletions(-) 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, - }, - }, }), ], }