mirror of
https://github.com/tenrok/vue-select.git
synced 2026-05-17 02:29:37 +03:00
471 lines
13 KiB
HTML
471 lines
13 KiB
HTML
|
|
<!DOCTYPE HTML>
|
|
<html lang="" >
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
|
|
<title>Templating · vue-select</title>
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
|
<meta name="description" content="">
|
|
<meta name="generator" content="GitBook 3.2.3">
|
|
|
|
|
|
|
|
|
|
<link rel="stylesheet" href="../gitbook/style.css">
|
|
|
|
|
|
|
|
|
|
<link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
|
|
|
|
|
|
|
|
<link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<link rel="stylesheet" href="../styles/website.css">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<meta name="HandheldFriendly" content="true"/>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
|
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
|
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
|
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
|
|
<link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">
|
|
|
|
|
|
<link rel="next" href="Vuex.html" />
|
|
|
|
|
|
|
|
</head>
|
|
<body>
|
|
|
|
<div class="book">
|
|
<div class="book-summary">
|
|
|
|
|
|
<div id="book-search-input" role="search">
|
|
<input type="text" placeholder="Type to search" />
|
|
</div>
|
|
|
|
|
|
<nav role="navigation">
|
|
|
|
|
|
|
|
<ul class="summary">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="chapter " data-level="1.1" data-path="../">
|
|
|
|
<a href="../">
|
|
|
|
|
|
Introduction
|
|
|
|
</a>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
<li class="chapter " data-level="1.2" >
|
|
|
|
<span>
|
|
|
|
|
|
Getting Started
|
|
|
|
</span>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
<li class="chapter " data-level="1.3" data-path="../Install.html">
|
|
|
|
<a href="../Install.html">
|
|
|
|
|
|
Installation
|
|
|
|
</a>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
<li class="chapter " data-level="1.4" data-path="../Basics/Options.html">
|
|
|
|
<a href="../Basics/Options.html">
|
|
|
|
|
|
Dropdown Options
|
|
|
|
</a>
|
|
|
|
|
|
|
|
<ul class="articles">
|
|
|
|
|
|
<li class="chapter " data-level="1.4.1" data-path="../Basics/Options.html">
|
|
|
|
<a href="../Basics/Options.html#labels">
|
|
|
|
|
|
Option Labels
|
|
|
|
</a>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
<li class="chapter " data-level="1.4.2" data-path="../Basics/Options.html">
|
|
|
|
<a href="../Basics/Options.html#null">
|
|
|
|
|
|
Null Options
|
|
|
|
</a>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
|
|
</ul>
|
|
|
|
</li>
|
|
|
|
<li class="chapter " data-level="1.5" data-path="../Basics/Values.html">
|
|
|
|
<a href="../Basics/Values.html#values">
|
|
|
|
|
|
Selecting Values
|
|
|
|
</a>
|
|
|
|
|
|
|
|
<ul class="articles">
|
|
|
|
|
|
<li class="chapter " data-level="1.5.1" data-path="../Basics/Values.html">
|
|
|
|
<a href="../Basics/Values.html#single">
|
|
|
|
|
|
Single
|
|
|
|
</a>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
<li class="chapter " data-level="1.5.2" data-path="../Basics/Values.html">
|
|
|
|
<a href="../Basics/Values.html#multiple">
|
|
|
|
|
|
Multiple
|
|
|
|
</a>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
<li class="chapter " data-level="1.5.3" data-path="../Basics/Values.html">
|
|
|
|
<a href="../Basics/Values.html#tagging">
|
|
|
|
|
|
Tagging
|
|
|
|
</a>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
|
|
</ul>
|
|
|
|
</li>
|
|
|
|
<li class="chapter " data-level="1.6" data-path="../Basics/Localization.html">
|
|
|
|
<a href="../Basics/Localization.html">
|
|
|
|
|
|
Localization
|
|
|
|
</a>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
<li class="chapter " data-level="1.7" >
|
|
|
|
<span>
|
|
|
|
|
|
Digging Deeper
|
|
|
|
</span>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
<li class="chapter active" data-level="1.8" data-path="Templating.html">
|
|
|
|
<a href="Templating.html">
|
|
|
|
|
|
Templating
|
|
|
|
</a>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
<li class="chapter " data-level="1.9" data-path="Vuex.html">
|
|
|
|
<a href="Vuex.html">
|
|
|
|
|
|
Vuex
|
|
|
|
</a>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
<li class="chapter " data-level="1.10" data-path="Ajax.html">
|
|
|
|
<a href="Ajax.html">
|
|
|
|
|
|
AJAX
|
|
|
|
</a>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
<li class="chapter " data-level="1.11" data-path="../Examples.html">
|
|
|
|
<a href="../Examples.html">
|
|
|
|
|
|
Examples
|
|
|
|
</a>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
<li class="chapter " data-level="1.12" >
|
|
|
|
<span>
|
|
|
|
|
|
API
|
|
|
|
</span>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
<li class="chapter " data-level="1.13" data-path="../Api/Props.html">
|
|
|
|
<a href="../Api/Props.html">
|
|
|
|
|
|
Props
|
|
|
|
</a>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
<li class="divider"></li>
|
|
|
|
<li>
|
|
<a href="https://www.gitbook.com" target="blank" class="gitbook-link">
|
|
Published with GitBook
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
</nav>
|
|
|
|
|
|
</div>
|
|
|
|
<div class="book-body">
|
|
|
|
<div class="body-inner">
|
|
|
|
|
|
|
|
<div class="book-header" role="navigation">
|
|
|
|
|
|
<!-- Title -->
|
|
<h1>
|
|
<i class="fa fa-circle-o-notch fa-spin"></i>
|
|
<a href=".." >Templating</a>
|
|
</h1>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="page-wrapper" tabindex="-1" role="main">
|
|
<div class="page-inner">
|
|
|
|
<div id="book-search-results">
|
|
<div class="search-noresults">
|
|
|
|
<section class="normal markdown-section">
|
|
|
|
<h4 id="scoped-slot-option">Scoped Slot <code>option</code></h4>
|
|
<p>vue-select provides the scoped <code>option</code> slot in order to create custom dropdown templates.</p>
|
|
<pre><code class="lang-html"><span class="hljs-tag"><<span class="hljs-name">v-select</span> <span class="hljs-attr">:options</span>=<span class="hljs-string">"options"</span> <span class="hljs-attr">label</span>=<span class="hljs-string">"title"</span>></span>
|
|
<span class="hljs-tag"><<span class="hljs-name">template</span> <span class="hljs-attr">slot</span>=<span class="hljs-string">"option"</span> <span class="hljs-attr">slot-scope</span>=<span class="hljs-string">"option"</span>></span>
|
|
<span class="hljs-tag"><<span class="hljs-name">span</span> <span class="hljs-attr">:class</span>=<span class="hljs-string">"option.icon"</span>></span><span class="hljs-tag"></<span class="hljs-name">span</span>></span>
|
|
{{ option.title }}
|
|
<span class="hljs-tag"></<span class="hljs-name">template</span>></span>
|
|
<span class="hljs-tag"></<span class="hljs-name">v-select</span>></span>
|
|
</code></pre>
|
|
<p>Using the <code>option</code> slot with <code>slot-scope="option"</code> gives the
|
|
provides the current option variable to the template.</p>
|
|
<p></p><p data-height="500" data-theme-id="32252" data-slug-hash="NXBwYG" data-default-tab="result" data-user="sagalbot" class="codepen">See the Pen <a href="http://codepen.io/sagalbot/pen/NXBwYG/" target="_blank"></a> by sagalbot (<a href="http://codepen.io/sagalbot" target="_blank">@sagalbot</a>) on <a href="http://codepen.io" target="_blank">CodePen</a>.</p><p></p>
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
<div class="search-results">
|
|
<div class="has-results">
|
|
|
|
<h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
|
|
<ul class="search-results-list"></ul>
|
|
|
|
</div>
|
|
<div class="no-results">
|
|
|
|
<h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<a href="Vuex.html" class="navigation navigation-next navigation-unique" aria-label="Next page: Vuex">
|
|
<i class="fa fa-angle-right"></i>
|
|
</a>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<script>
|
|
var gitbook = gitbook || [];
|
|
gitbook.push(function() {
|
|
gitbook.page.hasChanged({"page":{"title":"Templating","level":"1.8","depth":1,"next":{"title":"Vuex","level":"1.9","depth":1,"path":"Advanced/Vuex.md","ref":"Advanced/Vuex.md","articles":[]},"previous":{"title":"Digging Deeper","level":"1.7","depth":1,"ref":"","articles":[]},"dir":"ltr"},"config":{"plugins":["edit-link","-fontsettings","codepen","include-csv"],"root":"./docs/gitbook","styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"include-csv":{},"github":{"url":"https://github.com/sagalbot/vue-select/"},"search":{},"codepen":{"theme":32252},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"highlight":{},"sharing":{"facebook":false,"twitter":false,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"edit-link":{"label":"Edit This Page","base":"https://github.com/sagalbot/vue-select/edit/gitbook/docs/gitbook"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"vue-select","links":{"sharing":{"facebook":false,"twitter":false}},"gitbook":">3.0.0"},"file":{"path":"Advanced/Templating.md","mtime":"2018-01-15T05:26:21.549Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-01-15T23:01:42.518Z"},"basePath":"..","book":{"language":""}});
|
|
});
|
|
</script>
|
|
</div>
|
|
|
|
|
|
<script src="../gitbook/gitbook.js"></script>
|
|
<script src="../gitbook/theme.js"></script>
|
|
|
|
|
|
<script src="../gitbook/gitbook-plugin-edit-link/plugin.js"></script>
|
|
|
|
|
|
|
|
<script src="../gitbook/gitbook-plugin-codepen/embed-codepen.js"></script>
|
|
|
|
|
|
|
|
<script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
|
|
|
|
|
|
|
|
<script src="../gitbook/gitbook-plugin-search/search.js"></script>
|
|
|
|
|
|
|
|
<script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
|
|
|
|
|
|
|
|
<script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
|
|
|
|
|
|
|
|
<script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
|
|
|
|
|
|
|
|
</body>
|
|
</html>
|
|
|