2
0
mirror of https://github.com/tenrok/vue-select.git synced 2026-06-10 07:52:23 +03:00

more doc work

This commit is contained in:
Jeff Sagal
2016-03-09 15:41:12 -08:00
parent 5df95ef851
commit 8968d75c7d
3 changed files with 13 additions and 6 deletions
+1 -1
View File
@@ -35,7 +35,7 @@ export default {
- `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.
- `options` An 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.
+1 -1
View File
@@ -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>&lt;select&gt;</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 &amp; 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>&lt;template&gt;\n &lt;div id=\"myApp\"&gt;\n &lt;v-select :value.sync=\"selected\" :options=\"options\"&gt;&lt;/v-select&gt;\n &lt;/div&gt;\n &lt;/template&gt;</code>\n\n <code class=language-markup>&lt;script&gt;</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>&lt;/script&gt;</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>&lt;select&gt;</code><ul><li>type: Boolean<li>default: true</ul><li><code>placeholder</code> Equivalent to <code>placeholder</code> attribute on an <code>&lt;input&gt;</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>"
;(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> Objects<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> Strings<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>&lt;select&gt;</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 &amp; 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>&lt;template&gt;\n &lt;div id=\"myApp\"&gt;\n &lt;v-select :value.sync=\"selected\" :options=\"options\"&gt;&lt;/v-select&gt;\n &lt;/div&gt;\n &lt;/template&gt;</code>\n\n <code class=language-markup>&lt;script&gt;</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>&lt;/script&gt;</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>options</code> An array of strings or objects to be used as dropdown choices. Supports <code>['foo','bar']</code> &amp; <code>[{label: 'Foo', value: 'foo'}]</code>. When using the <code>[{}]</code> syntax, the objects in the array can have as many properties as you need, as long as the object contains <code>value</code> and <code>label</code> keys.<ul><li>type: Array<li>default: []</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>&lt;select&gt;</code><ul><li>type: Boolean<li>default: true</ul><li><code>placeholder</code> Equivalent to <code>placeholder</code> attribute on an <code>&lt;input&gt;</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}")
+11 -4
View File
@@ -88,12 +88,12 @@
<label class="control-label">Options</label><br>
<div class="radio">
<label for="advanced">
<input id="advanced" type="radio" v-model="optionType" value="advanced"> Advanced
<input id="advanced" type="radio" v-model="optionType" value="advanced"> Objects
<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
<input id="simple" type="radio" v-model="optionType" value="simple"> Strings
<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>
@@ -139,7 +139,7 @@
<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">&#x3C;template&#x3E;
&#x3C;div id=&#x22;myApp&#x22;&#x3E;
@@ -173,6 +173,14 @@
</ul>
</li>
<li>
<code>options</code> An array of strings or objects to be used as dropdown choices. Supports <code>['foo','bar']</code> &amp; <code>[{label: 'Foo', value: 'foo'}]</code>. When using the <code>[{}]</code> syntax, the objects in the array can have as many properties as you need, as long as the object contains <code>value</code> and <code>label</code> keys.
<ul>
<li>type: Array</li>
<li>default: []</li>
</ul>
</li>
<li>
<code>maxHeight</code> Limit the height of the dropdown menu
<ul>
@@ -212,7 +220,6 @@
<li>default: true</li>
</ul>
</li>
</ul>
</div>