[新增] block 区块 辅助组件
This commit is contained in:
parent
909f21f972
commit
4abe76d8b9
20
docs/docs/zh-CN/components/block.md
Normal file
20
docs/docs/zh-CN/components/block.md
Normal file
@ -0,0 +1,20 @@
|
||||
::: demo
|
||||
|
||||
<template>
|
||||
<lay-block>引用区域的文字</lay-block>
|
||||
<lay-block nm>引用区域的文字</lay-block>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { ref } from 'vue'
|
||||
|
||||
export default {
|
||||
setup() {
|
||||
|
||||
return {
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
:::
|
@ -16,4 +16,4 @@ export default {
|
||||
}
|
||||
</script>
|
||||
|
||||
:::
|
||||
:::
|
||||
|
@ -17,6 +17,7 @@
|
||||
<li><router-link to="/zh-CN/components/grid">栅格</router-link></li>
|
||||
<li><router-link to="/zh-CN/components/form">表单</router-link></li>
|
||||
<li><router-link to="/zh-CN/components/badge">徽章</router-link></li>
|
||||
<li><router-link to="/zh-CN/components/block">区块</router-link></li>
|
||||
</ul>
|
||||
</lay-side>
|
||||
<lay-body>
|
||||
|
@ -54,6 +54,11 @@ const zhCN = [
|
||||
path: '/zh-CN/components/badge',
|
||||
component: () => import('../../docs/zh-CN/components/badge.md'),
|
||||
meta: { title: '徽章' },
|
||||
},
|
||||
{
|
||||
path: '/zh-CN/components/block',
|
||||
component: () => import('../../docs/zh-CN/components/block.md'),
|
||||
meta: { title: '辅助' },
|
||||
}
|
||||
],
|
||||
},
|
||||
|
@ -21,6 +21,7 @@ import LayCol from "./module/col/index"
|
||||
import LayRow from "./module/row/index"
|
||||
import LayInput from "./module/input/index"
|
||||
import LayBadge from "./module/badge/index"
|
||||
import LayBlock from "./module/block/index"
|
||||
|
||||
const components: Record<string, IDefineComponent> = {
|
||||
LayRadio,
|
||||
@ -40,7 +41,8 @@ const components: Record<string, IDefineComponent> = {
|
||||
LayRow,
|
||||
LayCol,
|
||||
LayInput,
|
||||
LayBadge
|
||||
LayBadge,
|
||||
LayBlock
|
||||
}
|
||||
|
||||
const install = (app: App, options?: InstallOptions): void => {
|
||||
@ -72,6 +74,7 @@ export {
|
||||
LayCol,
|
||||
LayInput,
|
||||
LayBadge,
|
||||
LayBlock,
|
||||
install,
|
||||
}
|
||||
|
||||
|
9
src/module/block/index.ts
Normal file
9
src/module/block/index.ts
Normal 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 || 'LayBlock', Component)
|
||||
}
|
||||
|
||||
export default Component as IDefineComponent
|
14
src/module/block/index.vue
Normal file
14
src/module/block/index.vue
Normal file
@ -0,0 +1,14 @@
|
||||
<template>
|
||||
<blockquote class="layui-elem-quote" :class="[nm?'layui-quote-nm':'']">
|
||||
<slot></slot>
|
||||
</blockquote>
|
||||
</template>
|
||||
|
||||
<script setup name="LayBlock" lang="ts">
|
||||
import { defineProps } from '@vue/runtime-core'
|
||||
|
||||
const props =
|
||||
defineProps<{
|
||||
nm?: boolean
|
||||
}>()
|
||||
</script>
|
Loading…
Reference in New Issue
Block a user