layui/example/docs/zh-CN/guide/getStarted.md

46 lines
711 B
Markdown
Raw Normal View History

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