2021-10-26 01:13:23 +08:00
|
|
|
::: title 快速上手
|
2021-10-15 17:50:50 +08:00
|
|
|
:::
|
|
|
|
|
2021-10-27 02:04:47 +08:00
|
|
|
<br>
|
|
|
|
|
2021-12-07 18:25:49 +08:00
|
|
|
::: describe 1. 使用 npm 下载
|
2021-10-27 02:04:47 +08:00
|
|
|
:::
|
2021-10-12 11:30:07 +08:00
|
|
|
|
2021-09-29 17:22:33 +08:00
|
|
|
```
|
|
|
|
npm install @layui/layui-vue --save
|
|
|
|
```
|
2021-09-30 01:44:02 +08:00
|
|
|
|
2021-10-19 22:28:44 +08:00
|
|
|
<br>
|
|
|
|
|
2021-12-07 18:25:49 +08:00
|
|
|
::: describe 2. 在 main.ts 中依赖
|
2021-10-27 02:04:47 +08:00
|
|
|
:::
|
2021-10-12 11:30:07 +08:00
|
|
|
|
2021-09-30 01:44:02 +08:00
|
|
|
```js
|
|
|
|
import App from './App.vue'
|
|
|
|
import { createApp } from 'vue'
|
|
|
|
import Layui from '@layui/layui-vue'
|
2021-11-28 18:53:42 +08:00
|
|
|
import '@layui/layui-vue/lib/index.css'
|
2021-09-30 01:44:02 +08:00
|
|
|
|
2021-10-12 11:30:07 +08:00
|
|
|
createApp(App).use(Layui).mount('#app')
|
2021-10-01 03:03:24 +08:00
|
|
|
```
|
|
|
|
|
2021-10-19 22:28:44 +08:00
|
|
|
<br>
|
|
|
|
|
2021-12-07 18:25:49 +08:00
|
|
|
::: describe 3. 在 index.vue 使用
|
2021-10-27 02:04:47 +08:00
|
|
|
:::
|
2021-10-12 11:30:07 +08:00
|
|
|
|
2021-10-01 03:03:24 +08:00
|
|
|
```html
|
|
|
|
<lay-layout>
|
2021-10-12 11:30:07 +08:00
|
|
|
<lay-header>
|
|
|
|
<lay-logo>Layui Admin</lay-logo>
|
|
|
|
</lay-header>
|
|
|
|
<lay-side></lay-side>
|
|
|
|
<lay-body>
|
|
|
|
<router-view></router-view>
|
|
|
|
</lay-body>
|
|
|
|
<lay-footer>pearadmin.com</lay-footer>
|
2021-10-01 03:03:24 +08:00
|
|
|
</lay-layout>
|
2021-10-08 00:17:34 +08:00
|
|
|
```
|
2021-10-12 11:30:07 +08:00
|
|
|
|
2021-10-19 22:28:44 +08:00
|
|
|
- 前往: [layui-vue-sample](https://gitee.com/layui-vue/layui-vue-sample)
|