mirror of
https://github.com/tenrok/vue-select.git
synced 2026-06-01 05:54:03 +03:00
add params to docs/readme, remove ajax prop
This commit is contained in:
@@ -31,6 +31,29 @@ export default {
|
||||
</script>
|
||||
```
|
||||
|
||||
## Parameters
|
||||
- `value` Represents the currently selected value(s). Can be `null`, an empty string, or `[]`. If `multiple` is true, the current value will be represented in an array, otherwise it will be a single string or object, depending on what you've passed for `options`.
|
||||
- twoway: true,
|
||||
- required: true
|
||||
- `options` Any array of strings or objects to be used as dropdown choices. Supports `['foo','bar']` & `[{label: 'Foo', value: 'foo'}]`. When using the `[{}]` syntax, the objects in the array can have as many properties as you need, as long as the object contains `value` and `label` keys.
|
||||
- type: `Array`
|
||||
- default: `[]`
|
||||
- `maxHeight` Limit the height of the dropdown menu.
|
||||
- type: String
|
||||
- default: '400px'
|
||||
- `searchable` Toggle filtering of options.
|
||||
- type: Boolean
|
||||
- default: true
|
||||
- `multiple` Equivalent to `multiple` attribute on a `<select>`.
|
||||
- type: Boolean
|
||||
- default: true
|
||||
- `placeholder` Equivalent to `placeholder` attribute on an `<input>`.
|
||||
- type: String
|
||||
- default: ' '
|
||||
- `transition` Vue `transition` prop applied to the `.dropdown-menu`.
|
||||
- type: Boolean
|
||||
- default: true
|
||||
|
||||
## Todos:
|
||||
- fix layout issues with multiple selections
|
||||
- tags overflow outside `.dropdown`
|
||||
@@ -39,6 +62,7 @@ export default {
|
||||
- `simple` prop that disables `search` and keeps a static `placeholder` regardless of current selection (useful for things like icon button dropdowns)
|
||||
- less opinionated styles / only include css necessary to acheive layout (no colors, etc)
|
||||
- ability to pre-select options when using `[{label: 'Foo', value: 'foo'}]` syntax (already works with `['foo','bar','baz']` syntax
|
||||
-
|
||||
- more tests!!
|
||||
|
||||
|
||||
|
||||
Vendored
+1
-5
@@ -10250,7 +10250,7 @@ exports.default = {
|
||||
}
|
||||
};
|
||||
if (module.exports.__esModule) module.exports = module.exports.default
|
||||
;(typeof module.exports === "function"? module.exports.options: module.exports).template = "<div class=\"jumbotron jumbotron-top\"><div class=container><h1>Vue Select</h1><p class=lead>A simple component that provides similar functionality to Select2 without the overhead of jQuery.</p><a class=\"btn btn-custom\" href=https://github.com/sagalbot/vue-select>View on GitHub</a></div></div><div class=\"jumbotron jumbotron-green\"><div class=container><div class=row><div class=\"col-md-6 col-md-offset-1\"><v-select id=v-select :placeholder=placeholder :value.sync=select :options=options[optionType] :multiple=multiple></v-select></div><div class=col-md-4><pre id=output>{{ select | json }}</pre></div></div></div></div><div id=app class=container><h2 class=page-header>Live Edit <small>play around with the above vue-select</small></h2><div class=row><div class=col-md-6><label class=control-label>Options</label><br><div class=radio><label for=advanced><input id=advanced type=radio v-model=optionType value=advanced> Advanced<pre><code class=language-javascript>[{value: 'foo', label: 'Foo'}]</code></pre></label><br><label for=simple><input id=simple type=radio v-model=optionType value=simple> Simple<pre><code class=language-javascript>['foo', 'bar']</code></pre></label><span class=help-block>The <code>options</code> property is watched for changes, and the value is reset anytime the options change. This is useful if you have multiple selection boxes that depend on its ancestors values.</span></div></div><div class=col-md-6><div class=form-group><label class=control-label>Allow Multiple</label><div class=checkbox><label class=control-label><input v-model=multiple type=checkbox> True</label><span class=help-block>Equivalent to the <code>multiple</code> attribute to a <code><select></code>. You'll want to clear any selections you have made before changing this option. It's not one that should be changed after render.</span></div></div><div class=form-group><label class=control-label>Max Height</label><input type=text v-model=maxHeight class=form-control> <span class=help-block>Limit the height of the dropdown menu.</span></div><div class=form-group><label class=control-label>Placeholder</label><input type=text v-model=placeholder class=form-control> <span class=help-block>Equivalent to the <code>placeholder</code> attribute.</span></div></div></div><div class=row><div class=col-md-6><h2 class=page-header>Installing</h2><h5>Install from GitHub using NPM</h5><pre><code class=language-c-like>$ npm install sagalbot/vue-select</code></pre><h5>Updating</h5><p>Some versions of NPM don't properly update packages installed from GitHub. In this case, just use the install line above to update.</div><div class=col-md-6><h2 class=page-header>Usage</h2><pre v-pre=\"\"> <code class=language-markup><template>\n <div id=\"myApp\">\n <v-select :value.sync=\"selected\" :options=\"options\"></v-select>\n </div>\n </template></code>\n\n <code class=language-markup><script></code>\n <code class=language-javascript>import vSelect from 'vue-select'\n export default {\n components: {vSelect},\n\n data() {\n return {\n selected: null,\n options: ['foo','bar','baz']\n }\n }\n }</code>\n <code class=language-markup></script></code>\n </pre></div></div></div>"
|
||||
;(typeof module.exports === "function"? module.exports.options: module.exports).template = "<div class=\"jumbotron jumbotron-top\"><div class=container><h1>Vue Select</h1><p class=lead>A simple component that provides similar functionality to Select2 without the overhead of jQuery.</p><a class=\"btn btn-custom\" href=https://github.com/sagalbot/vue-select>View on GitHub</a></div></div><div class=\"jumbotron jumbotron-green\"><div class=container><div class=row><div class=\"col-md-6 col-md-offset-1\"><v-select id=v-select :placeholder=placeholder :value.sync=select :options=options[optionType] :multiple=multiple></v-select></div><div class=col-md-4><pre id=output>{{ select | json }}</pre></div></div></div></div><div id=app class=container><h2 class=page-header>Live Edit <small>play around with the above vue-select</small></h2><div class=row><div class=col-md-6><label class=control-label>Options</label><br><div class=radio><label for=advanced><input id=advanced type=radio v-model=optionType value=advanced> Advanced<pre><code class=language-javascript>[{value: 'foo', label: 'Foo'}]</code></pre></label><br><label for=simple><input id=simple type=radio v-model=optionType value=simple> Simple<pre><code class=language-javascript>['foo', 'bar']</code></pre></label><span class=help-block>The <code>options</code> property is watched for changes, and the value is reset anytime the options change. This is useful if you have multiple selection boxes that depend on its ancestors values.</span></div></div><div class=col-md-6><div class=form-group><label class=control-label>Allow Multiple</label><div class=checkbox><label class=control-label><input v-model=multiple type=checkbox> True</label><span class=help-block>Equivalent to the <code>multiple</code> attribute to a <code><select></code>. You'll want to clear any selections you have made before changing this option. It's not one that should be changed after render.</span></div></div><div class=form-group><label class=control-label>Max Height</label><input type=text v-model=maxHeight class=form-control> <span class=help-block>Limit the height of the dropdown menu.</span></div><div class=form-group><label class=control-label>Placeholder</label><input type=text v-model=placeholder class=form-control> <span class=help-block>Equivalent to the <code>placeholder</code> attribute.</span></div></div></div><div class=row><div class=col-md-6><h2 class=page-header>Install & Usage</h2><h5>Install from GitHub using NPM</h5><pre><code class=language-c-like>$ npm install sagalbot/vue-select</code></pre><pre v-pre=\"\"> <code class=language-markup><template>\n <div id=\"myApp\">\n <v-select :value.sync=\"selected\" :options=\"options\"></v-select>\n </div>\n </template></code>\n\n <code class=language-markup><script></code>\n <code class=language-javascript>import vSelect from 'vue-select'\n export default {\n components: {vSelect},\n\n data() {\n return {\n selected: null,\n options: ['foo','bar','baz']\n }\n }\n }</code>\n <code class=language-markup></script></code>\n </pre></div><div class=col-md-6><h2 class=page-header>Parameters</h2><ul><li><code>value</code> Represents the currently selected value(s)<ul><li>type: String<li>required: true</ul><li><code>maxHeight</code> Limit the height of the dropdown menu<ul><li>type: String<li>default: '400px'</ul><li><code>searchable</code> Toggle filtering of options<ul><li>type: Boolean<li>default: true</ul><li><code>multiple</code> Equivalent to <code>multiple</code> attribute on a <code><select></code><ul><li>type: Boolean<li>default: true</ul><li><code>placeholder</code> Equivalent to <code>placeholder</code> attribute on an <code><input></code><ul><li>type: String<li>default: ''</ul><li><code>transition</code> Vue <code>transition</code> prop applied to the <code>.dropdown-menu</code><ul><li>type: Boolean<li>default: true</ul></ul></div></div></div>"
|
||||
|
||||
},{"./components/Select.vue":36,"./countries.js":37,"./simpleCountries.js":39,"vue":33,"vueify-insert-css":34}],36:[function(require,module,exports){
|
||||
var __vueify_style__ = require("vueify-insert-css").insert(".dropdown[_v-3d450ab6]{position:relative}.dropdown-toggle[_v-3d450ab6]{display:block;padding:0;background:none;border:1px solid rgba(60,60,60,.26)}.dropdown-toggle[_v-3d450ab6]:active,.dropdown-toggle[_v-3d450ab6]:focus,.dropdown-toggle[_v-3d450ab6]:hover,.open .dropdown-toggle[_v-3d450ab6]:active,.open .dropdown-toggle[_v-3d450ab6]:focus,.open .dropdown-toggle[_v-3d450ab6]:hover{background:none}.open .dropdown-toggle[_v-3d450ab6]{background:none;border-color:#337ab7;border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.dropdown-menu[_v-3d450ab6]{margin:0;width:100%;overflow-y:scroll;border-top:none;border-color:#337ab7;border-top-left-radius:0;border-top-right-radius:0}.alert[_v-3d450ab6]{margin:0;margin-left:6px;padding:.25em}.alert .close[_v-3d450ab6]{float:none;margin-right:0;font-size:20px}input[type=search][_v-3d450ab6]{display:inline-block;border:none;outline:none;margin:0;width:100%;background:none;position:relative;box-shadow:none}input[type=search][_v-3d450ab6]:focus{box-shadow:none}input[type=search].inline[_v-3d450ab6]{width:auto}.dropdown-toggle[_v-3d450ab6]:after{display:block;position:absolute;top:10px;right:10px;display:inline-block;font-family:Glyphicons Halflings;font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased;content:\"\\e114\";-webkit-transition:all .15s cubic-bezier(1,-.115,.975,.855);transition:all .15s cubic-bezier(1,-.115,.975,.855);-webkit-transition-timing-function:cubic-bezier(1,-.115,.975,.855);transition-timing-function:cubic-bezier(1,-.115,.975,.855)}.open .dropdown-toggle[_v-3d450ab6]:after{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.form-control[_v-3d450ab6]{border:none}li a[_v-3d450ab6]{cursor:pointer}.active a[_v-3d450ab6]{background:rgba(50,50,50,.1);color:#333}.highlight a[_v-3d450ab6],li:hover a[_v-3d450ab6]{background:#337ab7;color:#fff}")
|
||||
@@ -10298,10 +10298,6 @@ exports.default = {
|
||||
default: function _default() {
|
||||
return [];
|
||||
}
|
||||
},
|
||||
ajax: {
|
||||
type: String,
|
||||
default: null
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
+56
-9
@@ -136,17 +136,10 @@
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<h2 class="page-header">Installing</h2>
|
||||
<h2 class="page-header">Install & Usage</h2>
|
||||
<h5>Install from GitHub using NPM</h5>
|
||||
<pre><code class="language-c-like">$ npm install sagalbot/vue-select</code></pre>
|
||||
|
||||
<h5>Updating</h5>
|
||||
<p>Some versions of NPM don't properly update packages installed from GitHub. In this case, just use the install line above to update.
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<h2 class="page-header">Usage</h2>
|
||||
|
||||
<pre v-pre>
|
||||
<code class="language-markup"><template>
|
||||
<div id="myApp">
|
||||
@@ -169,6 +162,60 @@
|
||||
<code class="language-markup"></script></code>
|
||||
</pre>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<h2 class="page-header">Parameters</h2>
|
||||
<ul>
|
||||
<li>
|
||||
<code>value</code> Represents the currently selected value(s)
|
||||
<ul>
|
||||
<li>type: String</li>
|
||||
<li>required: true </li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<code>maxHeight</code> Limit the height of the dropdown menu
|
||||
<ul>
|
||||
<li>type: String</li>
|
||||
<li>default: '400px'</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<code>searchable</code> Toggle filtering of options
|
||||
<ul>
|
||||
<li>type: Boolean</li>
|
||||
<li>default: true </li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<code>multiple</code> Equivalent to <code>multiple</code> attribute on a <code><select></code>
|
||||
<ul>
|
||||
<li>type: Boolean</li>
|
||||
<li>default: true</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<code>placeholder</code> Equivalent to <code>placeholder</code> attribute on an <code><input></code>
|
||||
<ul>
|
||||
<li>type: String</li>
|
||||
<li>default: ''</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<code>transition</code> Vue <code>transition</code> prop applied to the <code>.dropdown-menu</code>
|
||||
<ul>
|
||||
<li>type: Boolean</li>
|
||||
<li>default: true</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
@@ -186,10 +186,6 @@
|
||||
type: Array,
|
||||
default() { return [] },
|
||||
},
|
||||
ajax: {
|
||||
type: String,
|
||||
default: null
|
||||
}
|
||||
},
|
||||
|
||||
data() {
|
||||
|
||||
Reference in New Issue
Block a user