2021-10-26 01:13:23 +08:00
|
|
|
::: title 快速上手
|
2021-10-15 17:50:50 +08:00
|
|
|
:::
|
|
|
|
|
2022-02-25 13:17:06 +08:00
|
|
|
<br>
|
|
|
|
|
|
|
|
<p>
|
|
|
|
<a href="http://layui-vue.pearadmin.com" style="margin-left:30px;">
|
2022-02-27 12:55:09 +08:00
|
|
|
<img src="https://portrait.gitee.com/uploads/avatars/namespace/2868/8605626_layui_1634311144.png" alt="layui" width="105" style="border-radius:12px;">
|
2022-02-25 13:17:06 +08:00
|
|
|
</a>
|
2022-02-27 12:55:09 +08:00
|
|
|
<span style="font-size:32px;color:#e2e2e2;margin:30px;">+</span>
|
2022-02-25 13:17:06 +08:00
|
|
|
<a href="http://layui-vue.pearadmin.com">
|
2022-02-27 12:55:09 +08:00
|
|
|
<img src="https://qn.antdv.com/vue.png" alt="layui" width="105" style="border-radius:12px;">
|
2022-02-25 13:17:06 +08:00
|
|
|
</a>
|
2022-02-27 12:55:09 +08:00
|
|
|
<span style="font-size:32px;color:#e2e2e2;margin:30px;">=</span>
|
2022-02-25 13:17:06 +08:00
|
|
|
<a href="http://layui-vue.pearadmin.com">
|
2022-02-27 12:55:09 +08:00
|
|
|
<img src="../../../src/assets/logo.jpg" alt="layui" width="105" style="border-radius:12px;">
|
2022-02-25 13:17:06 +08:00
|
|
|
</a>
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<br>
|
2022-02-06 03:19:24 +08:00
|
|
|
|
2022-02-27 12:55:09 +08:00
|
|
|
::: describe 使用 npm 工具安装 layui vue, 然后你就可以使用打包工具, 如 vite rollup.
|
2022-02-07 13:42:38 +08:00
|
|
|
:::
|
2022-02-06 03:19:24 +08:00
|
|
|
|
2021-09-29 17:22:33 +08:00
|
|
|
```
|
2022-02-07 13:42:38 +08:00
|
|
|
npm install @layui/layui-vue --save
|
|
|
|
```
|
2022-01-29 10:50:44 +08:00
|
|
|
::: title 全局注册
|
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
|
|
|
```
|
2022-02-07 13:42:38 +08:00
|
|
|
::: describe 以上代码便完成了 layui-vue 的引入。需要注意的是,样式文件需要单独引入。
|
|
|
|
:::
|
2021-10-19 22:28:44 +08:00
|
|
|
|
2022-01-29 10:50:44 +08:00
|
|
|
::: title 按需引入
|
|
|
|
:::
|
|
|
|
|
|
|
|
```js
|
|
|
|
import App from './App.vue'
|
|
|
|
import { createApp } from 'vue'
|
|
|
|
import { LayButton, LayTable } from '@layui/layui-vue'
|
|
|
|
import '@layui/layui-vue/es/button/index.css';
|
|
|
|
import '@layui/layui-vue/es/table/index.css';
|
|
|
|
|
|
|
|
var app = createApp(App).
|
|
|
|
|
|
|
|
app.component("LayButton", LayButton);
|
|
|
|
app.component("LayTable", LayTable);
|
|
|
|
|
|
|
|
app.mount('#app')
|
|
|
|
```
|
|
|
|
|
2022-01-29 10:55:40 +08:00
|
|
|
::: title 基础示例
|
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
|
|
|
```
|
2022-02-07 13:42:38 +08:00
|
|
|
::: describe 您可以从现在起启动您的项目。 对于每个组件的用法,请参考单个组件对应的文档。
|
|
|
|
:::
|
|
|
|
|