docs: import on demand

This commit is contained in:
07akioni 2020-12-18 21:12:57 +08:00
parent 661631be52
commit ba35a17e19
2 changed files with 54 additions and 2 deletions

View File

@ -30,4 +30,30 @@ const app = createApp()
app.use(naive)
```
## Import on Demand (Working in Progress)
## Import on Demand
Here is a minimal example.
```js
import { createApp } from 'vue'
import {
// create naive ui
create,
// component
NButton,
// component style
buttonLight,
// locale
zhCN
} from 'naive-ui'
const naive = create({
locales: [zhCN],
styles: [buttonLight],
components: [NButton]
})
const app = createApp()
app.use(naive)
```

View File

@ -30,4 +30,30 @@ const app = createApp()
app.use(naive)
```
## 按需引入(正在开发)
## 按需引入
下面是一个按需引入的最小例子。
```js
import { createApp } from 'vue'
import {
// create naive ui
create,
// component
NButton,
// component style
buttonLight,
// locale
zhCN
} from 'naive-ui'
const naive = create({
locales: [zhCN],
styles: [buttonLight],
components: [NButton]
})
const app = createApp()
app.use(naive)
```