[新增] panel 组件

This commit is contained in:
就眠仪式 2021-09-27 06:59:01 +08:00
parent 5df6cfcbaf
commit 81785521f6
9 changed files with 57 additions and 29 deletions

View File

@ -1,5 +1,3 @@
##### 基础
::: demo 传入 columns 数据,自动生成表格
<template>
@ -25,8 +23,6 @@ export default {
:::
##### 尺寸
::: demo 传入 columns 数据,自动生成表格
<template>
@ -51,10 +47,3 @@ export default {
</script>
:::
#### 插槽
| name | 说明 | |
| :------------ | :-------------------------------------------|----------|
| type | 按钮类型 | `primary` `normal` `warm` `danger` |
| size | 按钮尺寸 | `lg` `sm` `xs`|

View File

@ -1,6 +1,4 @@
##### 基础
::: demo 传入 columns 数据,自动生成表格
::: demo
<template>
<lay-icon type="layui-icon-face-smile"></lay-icon>
@ -19,10 +17,3 @@ export default {
</script>
:::
#### 插槽
| name | 说明 | |
| :------------ | :-------------------------------------------|----------|
| type | 按钮类型 | `primary` `normal` `warm` `danger` |
| size | 按钮尺寸 | `lg` `sm` `xs`|

View File

@ -0,0 +1,19 @@
::: demo
<template>
<lay-panel><div style="padding: 30px;">面板</div></lay-panel>
</template>
<script>
import { ref } from 'vue'
export default {
setup() {
return {
}
}
}
</script>
:::

View File

@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/no-var-requires */
const fs = require('fs')
const path = require('path')

View File

@ -1,12 +1,17 @@
<template>
<lay-layout>
<lay-header>
<lay-logo>layui-logo</lay-logo>
<lay-logo>
layui-vue
</lay-logo>
</lay-header>
<lay-side>
<router-link to="/zh-CN/components/layout">布局</router-link>
<router-link to="/zh-CN/components/button">按钮</router-link>
<router-link to="/zh-CN/components/icon">图标</router-link>
<ul>
<li><router-link to="/zh-CN/components/layout">布局</router-link></li>
<li><router-link to="/zh-CN/components/button">按钮</router-link></li>
<li><router-link to="/zh-CN/components/icon">图标</router-link></li>
<li><router-link to="/zh-CN/components/panel">面板</router-link></li>
</ul>
</lay-side>
<lay-body>
<div style="padding: 20px">

View File

@ -28,6 +28,10 @@ const zhCN = [
path: '/zh-CN/components/icon',
component: () => import('../../docs/zh-CN/components/icon.md'),
meta: { title: '图标' },
},{
path: '/zh-CN/components/panel',
component: () => import('../../docs/zh-CN/components/panel.md'),
meta: { title: '面板' },
}
],
},

View File

@ -11,6 +11,7 @@ import LayBody from "./module/body/index"
import LayHeader from "./module/header/index"
import LayFooter from "./module/footer/index"
import LayLogo from "./module/logo/index"
import LayPanel from "./module/panel/index"
const components: Record<string, IDefineComponent> = {
LayRadio,
@ -21,7 +22,8 @@ const components: Record<string, IDefineComponent> = {
LayHeader,
LayBody,
LayFooter,
LayLogo
LayLogo,
LayPanel
}
const install = (app: App, options?: InstallOptions): void => {
@ -44,6 +46,7 @@ export {
LayBody,
LayFooter,
LayLogo,
LayPanel,
install,
}

View File

@ -0,0 +1,9 @@
import type { App } from 'vue'
import Component from './index.vue'
import type { IDefineComponent } from '../type/index'
Component.install = (app: App) => {
app.component(Component.name || 'LayLogo', Component)
}
export default Component as IDefineComponent

View File

@ -0,0 +1,9 @@
<template>
<div class="layui-panel">
<slot></slot>
</div>
</template>
<script setup name="LayPanel" lang="ts">
</script>