123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381 |
- import{_ as s,a,q as t,k as e}from"./index.3fe853a6.js";const o={pageData:{title:"Ant Design of Vue",description:"",frontmatter:{},headers:[{level:2,title:"Features",slug:"Features",content:""},{level:2,title:"Environment Support",slug:"Environment-Support",content:""},{level:2,title:"Version",slug:"Version",content:""},{level:2,title:"Installation",slug:"Installation",content:"Using npm or yarn"},{level:3,title:"Using npm or yarn",slug:"Using-npm-or-yarn",content:"**We recommend using npm or yarn to install**\uFF0Cit not only makes development easier\uFF0Cbut also allow you to take advantage of the rich ecosystem of Javascript packages and tooling."},{level:3,title:"Import in Browser",slug:"Import-in-Browser",content:"Add `script` and `link` tags in your browser and use the global variable `antd`."},{level:2,title:"Usage",slug:"Usage",content:""},{level:3,title:"Use modularized antd",slug:"Use-modularized-antd",content:""},{level:2,title:"Links",slug:"Links",content:""},{level:2,title:"Contributing",slug:"Contributing",content:"If you'd like to help us improve antd, just create a [Pull Request](https://github.com/vueComponent/ant-design-vue/pulls). Feel free to report bugs and issues [here](https://vuecomponent.github.io/issue-helper/)."},{level:2,title:"About ant-design-vue",slug:"About-ant-design-vue",content:"As we all know, Ant Design, as a design language, has gone through many years of iteration and accumulation. Its UI design ideas have become a set of de facto standards and are sought after and loved by many front-end developers and enterprises, and it is also a magic weapon in the hands of React developers. I hope that ant-design-vue will allow Vue developers to enjoy the excellent design of Ant Design."},{level:2,title:"THANK YOU",slug:"THANK-YOU",content:"[Ant Design Team](https://github.com/ant-design/ant-design/blob/master/AUTHORS.txt)"}],relativePath:"site/src/vueDocs/introduce.en-US.md",content:`# Ant Design of Vue
- Following the Ant Design specification, we developed a Vue UI library \`antd\` that contains a set of high quality components and demos for building rich, interactive user interfaces.
- <div class="pic-plus">
- <img width="150" src="https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg" />
- <span>+</span>
- <img width="160" src="https://qn.antdv.com/vue.png" />
- </div>
- <style>
- .pic-plus > * {
- display: inline-block !important;
- vertical-align: middle;
- }
- .pic-plus span {
- font-size: 30px;
- color: #aaa;
- margin: 0 20px;
- }
- </style>
- ## Features
- - An enterprise-class UI design language for web applications.
- - A set of high-quality Vue components out of the box.
- - Shared [Ant Design of React](https://ant.design/docs/spec/introduce) design resources.
- ## Environment Support
- - Modern browsers. You can use [1.x](https://1x.antdv.com/) for IE9+.
- - Server-side Rendering
- - [Electron](https://electronjs.org/)
- | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png" alt="IE / Edge" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)<br/> Edge | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png" alt="Firefox" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)<br/>Firefox | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png" alt="Chrome" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)<br/>Chrome | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari/safari_48x48.png" alt="Safari" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)<br/>Safari | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/opera/opera_48x48.png" alt="Opera" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)<br/>Opera | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/electron/electron_48x48.png" alt="Electron" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)<br/>Electron |
- | --- | --- | --- | --- | --- | --- |
- | Edge | last 2 versions | last 2 versions | last 2 versions | last 2 versions | last 2 versions |
- ## Version
- - Stable: [](https://www.npmjs.org/package/ant-design-vue)
- You can subscribe to this feed for new version notifications: https://github.com/vueComponent/ant-design-vue/releases.atom
- ## Installation
- ### Using npm or yarn
- **We recommend using npm or yarn to install**\uFF0Cit not only makes development easier\uFF0Cbut also allow you to take advantage of the rich ecosystem of Javascript packages and tooling.
- \`\`\`bash
- $ npm install ant-design-vue --save
- \`\`\`
- \`\`\`bash
- $ yarn add ant-design-vue
- \`\`\`
- If you are in a bad network environment\uFF0Cyou can try other registries and tools like [cnpm](https://github.com/cnpm/cnpm).
- ### Import in Browser
- Add \`script\` and \`link\` tags in your browser and use the global variable \`antd\`.
- We provide \`antd.js\` \`antd.css\` and \`antd.min.js\` \`antd.min.css\` under \`ant-design-vue/dist\` in antd's npm package. You can also download these files directly from [](https://www.jsdelivr.com/package/npm/ant-design-vue) or [unpkg](https://unpkg.com/ant-design-vue/dist/).
- > **We strongly discourage loading the entire files** this will add bloat to your application and make it more difficult to receive bugfixes and updates. Antd is intended to be used in conjunction with a build tool, such as [webpack](https://webpack.github.io/), which will make it easy to import only the parts of antd that you are using.
- > Note: you should import [dayjs](https://day.js.org/) and dayjs plugins before using antd.js.
- Like:
- \`\`\`html
- <script src="https://unpkg.com/dayjs/dayjs.min.js"></script>
- <script src="https://unpkg.com/dayjs/plugin/customParseFormat.js"></script>
- <script src="https://unpkg.com/dayjs/plugin/weekday.js"></script>
- <script src="https://unpkg.com/dayjs/plugin/localeData.js"></script>
- <script src="https://unpkg.com/dayjs/plugin/weekOfYear.js"></script>
- <script src="https://unpkg.com/dayjs/plugin/weekYear.js"></script>
- <script src="https://unpkg.com/dayjs/plugin/advancedFormat.js"></script>
- <script src="https://unpkg.com/dayjs/plugin/quarterOfYear.js"></script>
- \`\`\`
- ## Usage
- \`\`\`jsx
- import { DatePicker } from 'ant-design-vue';
- app.use(DatePicker);
- \`\`\`
- And import stylesheets manually:
- \`\`\`jsx
- import 'ant-design-vue/dist/antd.css'; // or 'ant-design-vue/dist/antd.less'
- \`\`\`
- ### Use modularized antd
- - Use [babel-plugin-import](https://github.com/ant-design/babel-plugin-import) (Recommended)
- \`\`\`jsx
- // .babelrc or babel-loader option
- {
- "plugins": [
- ["import", { "libraryName": "ant-design-vue", "libraryDirectory": "es", "style": "css" }] // \`style: true\` for less
- ]
- }
- \`\`\`
- > Note: Don't set \`libraryDirectory\` if you are using webpack 1.
- This allows you to import components from antd without having to manually import the corresponding stylesheet. The antd babel plugin will automatically import stylesheets.
- \`\`\`jsx
- // import js and css modularly, parsed by babel-plugin-import
- import { DatePicker } from 'ant-design-vue';
- \`\`\`
- - Manually import
- \`\`\`jsx
- import DatePicker from 'ant-design-vue/lib/date-picker'; // for js
- import 'ant-design-vue/lib/date-picker/style/css'; // for css
- // import 'ant-design-vue/lib/date-picker/style'; // that will import less
- \`\`\`
- - For Vite
- \`\`\`js
- // vite.config.js
- import Components from 'unplugin-vue-components/vite';
- import { AntDesignVueResolver } from 'unplugin-vue-components/resolvers';
- export default {
- plugins: [
- /* ... */
- Components({
- resolvers: [AntDesignVueResolver()],
- }),
- ],
- };
- \`\`\`
- ## Links
- - [Home Page](https://www.antdv.com/)
- - [Ant Design Of React](https://ant.design/)
- - [Components](https://www.antdv.com/components/overview)
- - [Change Log](/docs/vue/changelog)
- - [CodeSandbox template](https://codesandbox.io/s/agitated-franklin-1w72v) for bug reports
- - [Customize Theme](/docs/vue/customize-theme)
- - [FAQ](/docs/vue/faq)
- - [Support US](/docs/vue/sponsor)
- - [Awesome Ant Design](https://github.com/vueComponent/ant-design-vue-awesome)
- ## Contributing
- If you'd like to help us improve antd, just create a [Pull Request](https://github.com/vueComponent/ant-design-vue/pulls). Feel free to report bugs and issues [here](https://vuecomponent.github.io/issue-helper/).
- > If you're new to posting issues, we ask that you read [_How To Ask Questions The Smart Way_](http://www.catb.org/~esr/faqs/smart-questions.html) and [How to Ask a Question in Open Source Community](https://github.com/seajs/seajs/issues/545) and [How to Report Bugs Effectively](http://www.chiark.greenend.org.uk/~sgtatham/bugs.html) prior to posting. Well written bug reports help us help you!
- ## About ant-design-vue
- As we all know, Ant Design, as a design language, has gone through many years of iteration and accumulation. Its UI design ideas have become a set of de facto standards and are sought after and loved by many front-end developers and enterprises, and it is also a magic weapon in the hands of React developers. I hope that ant-design-vue will allow Vue developers to enjoy the excellent design of Ant Design.
- The ant-design-vue is the Vue implementation of Ant Design. The style of the component is kept in sync with Ant Design. The html structure and css style of the component are also consistent. The style 0 modification is really achieved, and the component API is kept as consistent as possible.
- Ant Design Vue is committed to providing programmers with a ** pleasant ** development experience.
- ## THANK YOU
- [Ant Design Team](https://github.com/ant-design/ant-design/blob/master/AUTHORS.txt)
- `,html:`<h1 id="Ant-Design-of-Vue">Ant Design of Vue <a class="header-anchor" href="#Ant-Design-of-Vue">
- <span aria-hidden="true" class="anchor">#</span>
- </a></h1>
- <p>Following the Ant Design specification, we developed a Vue UI library <code>antd</code> that contains a set of high quality components and demos for building rich, interactive user interfaces.</p>
- <div class="pic-plus">
- <img width="150" src="https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg" />
- <span>+</span>
- <img width="160" src="https://qn.antdv.com/vue.png" />
- </div>
- <h2 id="Features">Features <a class="header-anchor" href="#Features">
- <span aria-hidden="true" class="anchor">#</span>
- </a></h2>
- <ul>
- <li>An enterprise-class UI design language for web applications.</li>
- <li>A set of high-quality Vue components out of the box.</li>
- <li>Shared <a href="https://ant.design/docs/spec/introduce" target="_blank" rel="noopener noreferrer">Ant Design of React</a> design resources.</li>
- </ul>
- <h2 id="Environment-Support">Environment Support <a class="header-anchor" href="#Environment-Support">
- <span aria-hidden="true" class="anchor">#</span>
- </a></h2>
- <ul>
- <li>Modern browsers. You can use <a href="https://1x.antdv.com/" target="_blank" rel="noopener noreferrer">1.x</a> for IE9+.</li>
- <li>Server-side Rendering</li>
- <li><a href="https://electronjs.org/" target="_blank" rel="noopener noreferrer">Electron</a></li>
- </ul>
- <table>
- <thead>
- <tr>
- <th><a href="http://godban.github.io/browsers-support-badges/" target="_blank" rel="noopener noreferrer"><img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png" alt="IE / Edge" width="24px" height="24px" /></a><br/> Edge</th>
- <th><a href="http://godban.github.io/browsers-support-badges/" target="_blank" rel="noopener noreferrer"><img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png" alt="Firefox" width="24px" height="24px" /></a><br/>Firefox</th>
- <th><a href="http://godban.github.io/browsers-support-badges/" target="_blank" rel="noopener noreferrer"><img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png" alt="Chrome" width="24px" height="24px" /></a><br/>Chrome</th>
- <th><a href="http://godban.github.io/browsers-support-badges/" target="_blank" rel="noopener noreferrer"><img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari/safari_48x48.png" alt="Safari" width="24px" height="24px" /></a><br/>Safari</th>
- <th><a href="http://godban.github.io/browsers-support-badges/" target="_blank" rel="noopener noreferrer"><img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/opera/opera_48x48.png" alt="Opera" width="24px" height="24px" /></a><br/>Opera</th>
- <th><a href="http://godban.github.io/browsers-support-badges/" target="_blank" rel="noopener noreferrer"><img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/electron/electron_48x48.png" alt="Electron" width="24px" height="24px" /></a><br/>Electron</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>Edge</td>
- <td>last 2 versions</td>
- <td>last 2 versions</td>
- <td>last 2 versions</td>
- <td>last 2 versions</td>
- <td>last 2 versions</td>
- </tr>
- </tbody>
- </table>
- <h2 id="Version">Version <a class="header-anchor" href="#Version">
- <span aria-hidden="true" class="anchor">#</span>
- </a></h2>
- <ul>
- <li>Stable: <a href="https://www.npmjs.org/package/ant-design-vue" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/npm/v/ant-design-vue.svg?style=flat-square" alt="npm package"></a></li>
- </ul>
- <p>You can subscribe to this feed for new version notifications: <a href="https://github.com/vueComponent/ant-design-vue/releases.atom" target="_blank" rel="noopener noreferrer">https://github.com/vueComponent/ant-design-vue/releases.atom</a></p>
- <h2 id="Installation">Installation <a class="header-anchor" href="#Installation">
- <span aria-hidden="true" class="anchor">#</span>
- </a></h2>
- <h3 id="Using-npm-or-yarn">Using npm or yarn <a class="header-anchor" href="#Using-npm-or-yarn">
- <span aria-hidden="true" class="anchor">#</span>
- </a></h3>
- <p><strong>We recommend using npm or yarn to install</strong>\uFF0Cit not only makes development easier\uFF0Cbut also allow you to take advantage of the rich ecosystem of Javascript packages and tooling.</p>
- <pre class="language-bash" v-pre><code>$ <span class="token function">npm</span> <span class="token function">install</span> ant-design-vue <span class="token parameter variable">--save</span>
- </code></pre>
- <pre class="language-bash" v-pre><code>$ <span class="token function">yarn</span> <span class="token function">add</span> ant-design-vue
- </code></pre>
- <p>If you are in a bad network environment\uFF0Cyou can try other registries and tools like <a href="https://github.com/cnpm/cnpm" target="_blank" rel="noopener noreferrer">cnpm</a>.</p>
- <h3 id="Import-in-Browser">Import in Browser <a class="header-anchor" href="#Import-in-Browser">
- <span aria-hidden="true" class="anchor">#</span>
- </a></h3>
- <p>Add <code>script</code> and <code>link</code> tags in your browser and use the global variable <code>antd</code>.</p>
- <p>We provide <code>antd.js</code> <code>antd.css</code> and <code>antd.min.js</code> <code>antd.min.css</code> under <code>ant-design-vue/dist</code> in antd's npm package. You can also download these files directly from <a href="https://www.jsdelivr.com/package/npm/ant-design-vue" target="_blank" rel="noopener noreferrer"><img src="https://data.jsdelivr.com/v1/package/npm/ant-design-vue/badge" alt="jsdelivr"></a> or <a href="https://unpkg.com/ant-design-vue/dist/" target="_blank" rel="noopener noreferrer">unpkg</a>.</p>
- <blockquote>
- <p><strong>We strongly discourage loading the entire files</strong> this will add bloat to your application and make it more difficult to receive bugfixes and updates. Antd is intended to be used in conjunction with a build tool, such as <a href="https://webpack.github.io/" target="_blank" rel="noopener noreferrer">webpack</a>, which will make it easy to import only the parts of antd that you are using.</p>
- </blockquote>
- <blockquote>
- <p>Note: you should import <a href="https://day.js.org/" target="_blank" rel="noopener noreferrer">dayjs</a> and dayjs plugins before using antd.js.</p>
- </blockquote>
- <p>Like:</p>
- <pre class="language-html" v-pre><code><span class="token tag"><span class="token tag"><span class="token punctuation"><</span>script</span> <span class="token attr-name">src</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>https://unpkg.com/dayjs/dayjs.min.js<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span class="token script"></span><span class="token tag"><span class="token tag"><span class="token punctuation"></</span>script</span><span class="token punctuation">></span></span>
- <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>script</span> <span class="token attr-name">src</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>https://unpkg.com/dayjs/plugin/customParseFormat.js<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span class="token script"></span><span class="token tag"><span class="token tag"><span class="token punctuation"></</span>script</span><span class="token punctuation">></span></span>
- <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>script</span> <span class="token attr-name">src</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>https://unpkg.com/dayjs/plugin/weekday.js<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span class="token script"></span><span class="token tag"><span class="token tag"><span class="token punctuation"></</span>script</span><span class="token punctuation">></span></span>
- <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>script</span> <span class="token attr-name">src</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>https://unpkg.com/dayjs/plugin/localeData.js<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span class="token script"></span><span class="token tag"><span class="token tag"><span class="token punctuation"></</span>script</span><span class="token punctuation">></span></span>
- <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>script</span> <span class="token attr-name">src</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>https://unpkg.com/dayjs/plugin/weekOfYear.js<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span class="token script"></span><span class="token tag"><span class="token tag"><span class="token punctuation"></</span>script</span><span class="token punctuation">></span></span>
- <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>script</span> <span class="token attr-name">src</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>https://unpkg.com/dayjs/plugin/weekYear.js<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span class="token script"></span><span class="token tag"><span class="token tag"><span class="token punctuation"></</span>script</span><span class="token punctuation">></span></span>
- <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>script</span> <span class="token attr-name">src</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>https://unpkg.com/dayjs/plugin/advancedFormat.js<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span class="token script"></span><span class="token tag"><span class="token tag"><span class="token punctuation"></</span>script</span><span class="token punctuation">></span></span>
- <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>script</span> <span class="token attr-name">src</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>https://unpkg.com/dayjs/plugin/quarterOfYear.js<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span class="token script"></span><span class="token tag"><span class="token tag"><span class="token punctuation"></</span>script</span><span class="token punctuation">></span></span>
- </code></pre>
- <h2 id="Usage">Usage <a class="header-anchor" href="#Usage">
- <span aria-hidden="true" class="anchor">#</span>
- </a></h2>
- <pre class="language-jsx" v-pre><code><span class="token keyword">import</span> <span class="token punctuation">{</span> DatePicker <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">'ant-design-vue'</span><span class="token punctuation">;</span>
- app<span class="token punctuation">.</span><span class="token function">use</span><span class="token punctuation">(</span>DatePicker<span class="token punctuation">)</span><span class="token punctuation">;</span>
- </code></pre>
- <p>And import stylesheets manually:</p>
- <pre class="language-jsx" v-pre><code><span class="token keyword">import</span> <span class="token string">'ant-design-vue/dist/antd.css'</span><span class="token punctuation">;</span> <span class="token comment">// or 'ant-design-vue/dist/antd.less'</span>
- </code></pre>
- <h3 id="Use-modularized-antd">Use modularized antd <a class="header-anchor" href="#Use-modularized-antd">
- <span aria-hidden="true" class="anchor">#</span>
- </a></h3>
- <ul>
- <li>
- <p>Use <a href="https://github.com/ant-design/babel-plugin-import" target="_blank" rel="noopener noreferrer">babel-plugin-import</a> (Recommended)</p>
- <pre class="language-jsx" v-pre><code><span class="token comment">// .babelrc or babel-loader option</span>
- <span class="token punctuation">{</span>
- <span class="token string-property property">"plugins"</span><span class="token operator">:</span> <span class="token punctuation">[</span>
- <span class="token punctuation">[</span><span class="token string">"import"</span><span class="token punctuation">,</span> <span class="token punctuation">{</span> <span class="token string-property property">"libraryName"</span><span class="token operator">:</span> <span class="token string">"ant-design-vue"</span><span class="token punctuation">,</span> <span class="token string-property property">"libraryDirectory"</span><span class="token operator">:</span> <span class="token string">"es"</span><span class="token punctuation">,</span> <span class="token string-property property">"style"</span><span class="token operator">:</span> <span class="token string">"css"</span> <span class="token punctuation">}</span><span class="token punctuation">]</span> <span class="token comment">// \`style: true\` for less</span>
- <span class="token punctuation">]</span>
- <span class="token punctuation">}</span>
- </code></pre>
- <blockquote>
- <p>Note: Don't set <code>libraryDirectory</code> if you are using webpack 1.</p>
- </blockquote>
- <p>This allows you to import components from antd without having to manually import the corresponding stylesheet. The antd babel plugin will automatically import stylesheets.</p>
- <pre class="language-jsx" v-pre><code><span class="token comment">// import js and css modularly, parsed by babel-plugin-import</span>
- <span class="token keyword">import</span> <span class="token punctuation">{</span> DatePicker <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">'ant-design-vue'</span><span class="token punctuation">;</span>
- </code></pre>
- </li>
- <li>
- <p>Manually import</p>
- <pre class="language-jsx" v-pre><code><span class="token keyword">import</span> DatePicker <span class="token keyword">from</span> <span class="token string">'ant-design-vue/lib/date-picker'</span><span class="token punctuation">;</span> <span class="token comment">// for js</span>
- <span class="token keyword">import</span> <span class="token string">'ant-design-vue/lib/date-picker/style/css'</span><span class="token punctuation">;</span> <span class="token comment">// for css</span>
- <span class="token comment">// import 'ant-design-vue/lib/date-picker/style'; // that will import less</span>
- </code></pre>
- </li>
- <li>
- <p>For Vite</p>
- <pre class="language-js" v-pre><code><span class="token comment">// vite.config.js</span>
- <span class="token keyword">import</span> Components <span class="token keyword">from</span> <span class="token string">'unplugin-vue-components/vite'</span><span class="token punctuation">;</span>
- <span class="token keyword">import</span> <span class="token punctuation">{</span> AntDesignVueResolver <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">'unplugin-vue-components/resolvers'</span><span class="token punctuation">;</span>
- <span class="token keyword">export</span> <span class="token keyword">default</span> <span class="token punctuation">{</span>
- <span class="token literal-property property">plugins</span><span class="token operator">:</span> <span class="token punctuation">[</span>
- <span class="token comment">/* ... */</span>
- <span class="token function">Components</span><span class="token punctuation">(</span><span class="token punctuation">{</span>
- <span class="token literal-property property">resolvers</span><span class="token operator">:</span> <span class="token punctuation">[</span><span class="token function">AntDesignVueResolver</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">]</span><span class="token punctuation">,</span>
- <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
- <span class="token punctuation">]</span><span class="token punctuation">,</span>
- <span class="token punctuation">}</span><span class="token punctuation">;</span>
- </code></pre>
- </li>
- </ul>
- <h2 id="Links">Links <a class="header-anchor" href="#Links">
- <span aria-hidden="true" class="anchor">#</span>
- </a></h2>
- <ul>
- <li><a href="https://www.antdv.com/" target="_blank" rel="noopener noreferrer">Home Page</a></li>
- <li><a href="https://ant.design/" target="_blank" rel="noopener noreferrer">Ant Design Of React</a></li>
- <li><a href="https://www.antdv.com/components/overview" target="_blank" rel="noopener noreferrer">Components</a></li>
- <li><a href="/docs/vue/changelog">Change Log</a></li>
- <li><a href="https://codesandbox.io/s/agitated-franklin-1w72v" target="_blank" rel="noopener noreferrer">CodeSandbox template</a> for bug reports</li>
- <li><a href="/docs/vue/customize-theme">Customize Theme</a></li>
- <li><a href="/docs/vue/faq">FAQ</a></li>
- <li><a href="/docs/vue/sponsor">Support US</a></li>
- <li><a href="https://github.com/vueComponent/ant-design-vue-awesome" target="_blank" rel="noopener noreferrer">Awesome Ant Design</a></li>
- </ul>
- <h2 id="Contributing">Contributing <a class="header-anchor" href="#Contributing">
- <span aria-hidden="true" class="anchor">#</span>
- </a></h2>
- <p>If you'd like to help us improve antd, just create a <a href="https://github.com/vueComponent/ant-design-vue/pulls" target="_blank" rel="noopener noreferrer">Pull Request</a>. Feel free to report bugs and issues <a href="https://vuecomponent.github.io/issue-helper/" target="_blank" rel="noopener noreferrer">here</a>.</p>
- <blockquote>
- <p>If you're new to posting issues, we ask that you read <a href="http://www.catb.org/~esr/faqs/smart-questions.html" target="_blank" rel="noopener noreferrer"><em>How To Ask Questions The Smart Way</em></a> and <a href="https://github.com/seajs/seajs/issues/545" target="_blank" rel="noopener noreferrer">How to Ask a Question in Open Source Community</a> and <a href="http://www.chiark.greenend.org.uk/~sgtatham/bugs.html" target="_blank" rel="noopener noreferrer">How to Report Bugs Effectively</a> prior to posting. Well written bug reports help us help you!</p>
- </blockquote>
- <h2 id="About-ant-design-vue">About ant-design-vue <a class="header-anchor" href="#About-ant-design-vue">
- <span aria-hidden="true" class="anchor">#</span>
- </a></h2>
- <p>As we all know, Ant Design, as a design language, has gone through many years of iteration and accumulation. Its UI design ideas have become a set of de facto standards and are sought after and loved by many front-end developers and enterprises, and it is also a magic weapon in the hands of React developers. I hope that ant-design-vue will allow Vue developers to enjoy the excellent design of Ant Design.</p>
- <p>The ant-design-vue is the Vue implementation of Ant Design. The style of the component is kept in sync with Ant Design. The html structure and css style of the component are also consistent. The style 0 modification is really achieved, and the component API is kept as consistent as possible.</p>
- <p>Ant Design Vue is committed to providing programmers with a ** pleasant ** development experience.</p>
- <h2 id="THANK-YOU">THANK YOU <a class="header-anchor" href="#THANK-YOU">
- <span aria-hidden="true" class="anchor">#</span>
- </a></h2>
- <p><a href="https://github.com/ant-design/ant-design/blob/master/AUTHORS.txt" target="_blank" rel="noopener noreferrer">Ant Design Team</a></p>
- `,lastUpdated:1748060301811}},p={class:"markdown"};function r(i,n,l,c,u,g){return e(),a("article",p,n[0]||(n[0]=[t(`<h1 id="Ant-Design-of-Vue">Ant Design of Vue <a class="header-anchor" href="#Ant-Design-of-Vue"><span aria-hidden="true" class="anchor">#</span></a></h1><p>Following the Ant Design specification, we developed a Vue UI library <code>antd</code> that contains a set of high quality components and demos for building rich, interactive user interfaces.</p><div class="pic-plus"><img width="150" src="https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg"><span>+</span><img width="160" src="https://qn.antdv.com/vue.png"></div><h2 id="Features">Features <a class="header-anchor" href="#Features"><span aria-hidden="true" class="anchor">#</span></a></h2><ul><li>An enterprise-class UI design language for web applications.</li><li>A set of high-quality Vue components out of the box.</li><li>Shared <a href="https://ant.design/docs/spec/introduce" target="_blank" rel="noopener noreferrer">Ant Design of React</a> design resources.</li></ul><h2 id="Environment-Support">Environment Support <a class="header-anchor" href="#Environment-Support"><span aria-hidden="true" class="anchor">#</span></a></h2><ul><li>Modern browsers. You can use <a href="https://1x.antdv.com/" target="_blank" rel="noopener noreferrer">1.x</a> for IE9+.</li><li>Server-side Rendering</li><li><a href="https://electronjs.org/" target="_blank" rel="noopener noreferrer">Electron</a></li></ul><table><thead><tr><th><a href="http://godban.github.io/browsers-support-badges/" target="_blank" rel="noopener noreferrer"><img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png" alt="IE / Edge" width="24px" height="24px"></a><br> Edge</th><th><a href="http://godban.github.io/browsers-support-badges/" target="_blank" rel="noopener noreferrer"><img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png" alt="Firefox" width="24px" height="24px"></a><br>Firefox</th><th><a href="http://godban.github.io/browsers-support-badges/" target="_blank" rel="noopener noreferrer"><img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png" alt="Chrome" width="24px" height="24px"></a><br>Chrome</th><th><a href="http://godban.github.io/browsers-support-badges/" target="_blank" rel="noopener noreferrer"><img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari/safari_48x48.png" alt="Safari" width="24px" height="24px"></a><br>Safari</th><th><a href="http://godban.github.io/browsers-support-badges/" target="_blank" rel="noopener noreferrer"><img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/opera/opera_48x48.png" alt="Opera" width="24px" height="24px"></a><br>Opera</th><th><a href="http://godban.github.io/browsers-support-badges/" target="_blank" rel="noopener noreferrer"><img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/electron/electron_48x48.png" alt="Electron" width="24px" height="24px"></a><br>Electron</th></tr></thead><tbody><tr><td>Edge</td><td>last 2 versions</td><td>last 2 versions</td><td>last 2 versions</td><td>last 2 versions</td><td>last 2 versions</td></tr></tbody></table><h2 id="Version">Version <a class="header-anchor" href="#Version"><span aria-hidden="true" class="anchor">#</span></a></h2><ul><li>Stable: <a href="https://www.npmjs.org/package/ant-design-vue" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/npm/v/ant-design-vue.svg?style=flat-square" alt="npm package"></a></li></ul><p>You can subscribe to this feed for new version notifications: <a href="https://github.com/vueComponent/ant-design-vue/releases.atom" target="_blank" rel="noopener noreferrer">https://github.com/vueComponent/ant-design-vue/releases.atom</a></p><h2 id="Installation">Installation <a class="header-anchor" href="#Installation"><span aria-hidden="true" class="anchor">#</span></a></h2><h3 id="Using-npm-or-yarn">Using npm or yarn <a class="header-anchor" href="#Using-npm-or-yarn"><span aria-hidden="true" class="anchor">#</span></a></h3><p><strong>We recommend using npm or yarn to install</strong>\uFF0Cit not only makes development easier\uFF0Cbut also allow you to take advantage of the rich ecosystem of Javascript packages and tooling.</p><pre class="language-bash"><code>$ <span class="token function">npm</span> <span class="token function">install</span> ant-design-vue <span class="token parameter variable">--save</span>
- </code></pre><pre class="language-bash"><code>$ <span class="token function">yarn</span> <span class="token function">add</span> ant-design-vue
- </code></pre><p>If you are in a bad network environment\uFF0Cyou can try other registries and tools like <a href="https://github.com/cnpm/cnpm" target="_blank" rel="noopener noreferrer">cnpm</a>.</p><h3 id="Import-in-Browser">Import in Browser <a class="header-anchor" href="#Import-in-Browser"><span aria-hidden="true" class="anchor">#</span></a></h3><p>Add <code>script</code> and <code>link</code> tags in your browser and use the global variable <code>antd</code>.</p><p>We provide <code>antd.js</code> <code>antd.css</code> and <code>antd.min.js</code> <code>antd.min.css</code> under <code>ant-design-vue/dist</code> in antd's npm package. You can also download these files directly from <a href="https://www.jsdelivr.com/package/npm/ant-design-vue" target="_blank" rel="noopener noreferrer"><img src="https://data.jsdelivr.com/v1/package/npm/ant-design-vue/badge" alt="jsdelivr"></a> or <a href="https://unpkg.com/ant-design-vue/dist/" target="_blank" rel="noopener noreferrer">unpkg</a>.</p><blockquote><p><strong>We strongly discourage loading the entire files</strong> this will add bloat to your application and make it more difficult to receive bugfixes and updates. Antd is intended to be used in conjunction with a build tool, such as <a href="https://webpack.github.io/" target="_blank" rel="noopener noreferrer">webpack</a>, which will make it easy to import only the parts of antd that you are using.</p></blockquote><blockquote><p>Note: you should import <a href="https://day.js.org/" target="_blank" rel="noopener noreferrer">dayjs</a> and dayjs plugins before using antd.js.</p></blockquote><p>Like:</p><pre class="language-html"><code><span class="token tag"><span class="token tag"><span class="token punctuation"><</span>script</span> <span class="token attr-name">src</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>https://unpkg.com/dayjs/dayjs.min.js<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span class="token script"></span><span class="token tag"><span class="token tag"><span class="token punctuation"></</span>script</span><span class="token punctuation">></span></span>
- <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>script</span> <span class="token attr-name">src</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>https://unpkg.com/dayjs/plugin/customParseFormat.js<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span class="token script"></span><span class="token tag"><span class="token tag"><span class="token punctuation"></</span>script</span><span class="token punctuation">></span></span>
- <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>script</span> <span class="token attr-name">src</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>https://unpkg.com/dayjs/plugin/weekday.js<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span class="token script"></span><span class="token tag"><span class="token tag"><span class="token punctuation"></</span>script</span><span class="token punctuation">></span></span>
- <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>script</span> <span class="token attr-name">src</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>https://unpkg.com/dayjs/plugin/localeData.js<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span class="token script"></span><span class="token tag"><span class="token tag"><span class="token punctuation"></</span>script</span><span class="token punctuation">></span></span>
- <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>script</span> <span class="token attr-name">src</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>https://unpkg.com/dayjs/plugin/weekOfYear.js<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span class="token script"></span><span class="token tag"><span class="token tag"><span class="token punctuation"></</span>script</span><span class="token punctuation">></span></span>
- <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>script</span> <span class="token attr-name">src</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>https://unpkg.com/dayjs/plugin/weekYear.js<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span class="token script"></span><span class="token tag"><span class="token tag"><span class="token punctuation"></</span>script</span><span class="token punctuation">></span></span>
- <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>script</span> <span class="token attr-name">src</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>https://unpkg.com/dayjs/plugin/advancedFormat.js<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span class="token script"></span><span class="token tag"><span class="token tag"><span class="token punctuation"></</span>script</span><span class="token punctuation">></span></span>
- <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>script</span> <span class="token attr-name">src</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>https://unpkg.com/dayjs/plugin/quarterOfYear.js<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span class="token script"></span><span class="token tag"><span class="token tag"><span class="token punctuation"></</span>script</span><span class="token punctuation">></span></span>
- </code></pre><h2 id="Usage">Usage <a class="header-anchor" href="#Usage"><span aria-hidden="true" class="anchor">#</span></a></h2><pre class="language-jsx"><code><span class="token keyword">import</span> <span class="token punctuation">{</span> DatePicker <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">'ant-design-vue'</span><span class="token punctuation">;</span>
- app<span class="token punctuation">.</span><span class="token function">use</span><span class="token punctuation">(</span>DatePicker<span class="token punctuation">)</span><span class="token punctuation">;</span>
- </code></pre><p>And import stylesheets manually:</p><pre class="language-jsx"><code><span class="token keyword">import</span> <span class="token string">'ant-design-vue/dist/antd.css'</span><span class="token punctuation">;</span> <span class="token comment">// or 'ant-design-vue/dist/antd.less'</span>
- </code></pre><h3 id="Use-modularized-antd">Use modularized antd <a class="header-anchor" href="#Use-modularized-antd"><span aria-hidden="true" class="anchor">#</span></a></h3><ul><li><p>Use <a href="https://github.com/ant-design/babel-plugin-import" target="_blank" rel="noopener noreferrer">babel-plugin-import</a> (Recommended)</p><pre class="language-jsx"><code><span class="token comment">// .babelrc or babel-loader option</span>
- <span class="token punctuation">{</span>
- <span class="token string-property property">"plugins"</span><span class="token operator">:</span> <span class="token punctuation">[</span>
- <span class="token punctuation">[</span><span class="token string">"import"</span><span class="token punctuation">,</span> <span class="token punctuation">{</span> <span class="token string-property property">"libraryName"</span><span class="token operator">:</span> <span class="token string">"ant-design-vue"</span><span class="token punctuation">,</span> <span class="token string-property property">"libraryDirectory"</span><span class="token operator">:</span> <span class="token string">"es"</span><span class="token punctuation">,</span> <span class="token string-property property">"style"</span><span class="token operator">:</span> <span class="token string">"css"</span> <span class="token punctuation">}</span><span class="token punctuation">]</span> <span class="token comment">// \`style: true\` for less</span>
- <span class="token punctuation">]</span>
- <span class="token punctuation">}</span>
- </code></pre><blockquote><p>Note: Don't set <code>libraryDirectory</code> if you are using webpack 1.</p></blockquote><p>This allows you to import components from antd without having to manually import the corresponding stylesheet. The antd babel plugin will automatically import stylesheets.</p><pre class="language-jsx"><code><span class="token comment">// import js and css modularly, parsed by babel-plugin-import</span>
- <span class="token keyword">import</span> <span class="token punctuation">{</span> DatePicker <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">'ant-design-vue'</span><span class="token punctuation">;</span>
- </code></pre></li><li><p>Manually import</p><pre class="language-jsx"><code><span class="token keyword">import</span> DatePicker <span class="token keyword">from</span> <span class="token string">'ant-design-vue/lib/date-picker'</span><span class="token punctuation">;</span> <span class="token comment">// for js</span>
- <span class="token keyword">import</span> <span class="token string">'ant-design-vue/lib/date-picker/style/css'</span><span class="token punctuation">;</span> <span class="token comment">// for css</span>
- <span class="token comment">// import 'ant-design-vue/lib/date-picker/style'; // that will import less</span>
- </code></pre></li><li><p>For Vite</p><pre class="language-js"><code><span class="token comment">// vite.config.js</span>
- <span class="token keyword">import</span> Components <span class="token keyword">from</span> <span class="token string">'unplugin-vue-components/vite'</span><span class="token punctuation">;</span>
- <span class="token keyword">import</span> <span class="token punctuation">{</span> AntDesignVueResolver <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">'unplugin-vue-components/resolvers'</span><span class="token punctuation">;</span>
- <span class="token keyword">export</span> <span class="token keyword">default</span> <span class="token punctuation">{</span>
- <span class="token literal-property property">plugins</span><span class="token operator">:</span> <span class="token punctuation">[</span>
- <span class="token comment">/* ... */</span>
- <span class="token function">Components</span><span class="token punctuation">(</span><span class="token punctuation">{</span>
- <span class="token literal-property property">resolvers</span><span class="token operator">:</span> <span class="token punctuation">[</span><span class="token function">AntDesignVueResolver</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">]</span><span class="token punctuation">,</span>
- <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
- <span class="token punctuation">]</span><span class="token punctuation">,</span>
- <span class="token punctuation">}</span><span class="token punctuation">;</span>
- </code></pre></li></ul><h2 id="Links">Links <a class="header-anchor" href="#Links"><span aria-hidden="true" class="anchor">#</span></a></h2><ul><li><a href="https://www.antdv.com/" target="_blank" rel="noopener noreferrer">Home Page</a></li><li><a href="https://ant.design/" target="_blank" rel="noopener noreferrer">Ant Design Of React</a></li><li><a href="https://www.antdv.com/components/overview" target="_blank" rel="noopener noreferrer">Components</a></li><li><a href="/docs/vue/changelog">Change Log</a></li><li><a href="https://codesandbox.io/s/agitated-franklin-1w72v" target="_blank" rel="noopener noreferrer">CodeSandbox template</a> for bug reports</li><li><a href="/docs/vue/customize-theme">Customize Theme</a></li><li><a href="/docs/vue/faq">FAQ</a></li><li><a href="/docs/vue/sponsor">Support US</a></li><li><a href="https://github.com/vueComponent/ant-design-vue-awesome" target="_blank" rel="noopener noreferrer">Awesome Ant Design</a></li></ul><h2 id="Contributing">Contributing <a class="header-anchor" href="#Contributing"><span aria-hidden="true" class="anchor">#</span></a></h2><p>If you'd like to help us improve antd, just create a <a href="https://github.com/vueComponent/ant-design-vue/pulls" target="_blank" rel="noopener noreferrer">Pull Request</a>. Feel free to report bugs and issues <a href="https://vuecomponent.github.io/issue-helper/" target="_blank" rel="noopener noreferrer">here</a>.</p><blockquote><p>If you're new to posting issues, we ask that you read <a href="http://www.catb.org/~esr/faqs/smart-questions.html" target="_blank" rel="noopener noreferrer"><em>How To Ask Questions The Smart Way</em></a> and <a href="https://github.com/seajs/seajs/issues/545" target="_blank" rel="noopener noreferrer">How to Ask a Question in Open Source Community</a> and <a href="http://www.chiark.greenend.org.uk/~sgtatham/bugs.html" target="_blank" rel="noopener noreferrer">How to Report Bugs Effectively</a> prior to posting. Well written bug reports help us help you!</p></blockquote><h2 id="About-ant-design-vue">About ant-design-vue <a class="header-anchor" href="#About-ant-design-vue"><span aria-hidden="true" class="anchor">#</span></a></h2><p>As we all know, Ant Design, as a design language, has gone through many years of iteration and accumulation. Its UI design ideas have become a set of de facto standards and are sought after and loved by many front-end developers and enterprises, and it is also a magic weapon in the hands of React developers. I hope that ant-design-vue will allow Vue developers to enjoy the excellent design of Ant Design.</p><p>The ant-design-vue is the Vue implementation of Ant Design. The style of the component is kept in sync with Ant Design. The html structure and css style of the component are also consistent. The style 0 modification is really achieved, and the component API is kept as consistent as possible.</p><p>Ant Design Vue is committed to providing programmers with a ** pleasant ** development experience.</p><h2 id="THANK-YOU">THANK YOU <a class="header-anchor" href="#THANK-YOU"><span aria-hidden="true" class="anchor">#</span></a></h2><p><a href="https://github.com/ant-design/ant-design/blob/master/AUTHORS.txt" target="_blank" rel="noopener noreferrer">Ant Design Team</a></p>`,41)]))}const h=s(o,[["render",r]]);export{h as default};
|