[新增] collapse 组件
This commit is contained in:
		
							parent
							
								
									e069f5a273
								
							
						
					
					
						commit
						f574c2aac0
					
				
							
								
								
									
										23
									
								
								.pnpm-debug.log
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								.pnpm-debug.log
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,23 @@
 | 
			
		||||
{
 | 
			
		||||
  "0 debug pnpm:scope": {
 | 
			
		||||
    "selected": 1
 | 
			
		||||
  },
 | 
			
		||||
  "1 info pnpm": {
 | 
			
		||||
    "err": {
 | 
			
		||||
      "name": "Error",
 | 
			
		||||
      "message": "not found: insta",
 | 
			
		||||
      "code": "ENOENT",
 | 
			
		||||
      "stack": "Error: not found: insta\n    at getNotFoundError (D:\\service\\Nvm\\v16.6.2\\node_global\\node_modules\\pnpm\\dist\\pnpm.cjs:47811:51)\n    at Function.whichSync [as sync] (D:\\service\\Nvm\\v16.6.2\\node_global\\node_modules\\pnpm\\dist\\pnpm.cjs:47888:13)\n    at getCommandAbsolutePathSync (D:\\service\\Nvm\\v16.6.2\\node_global\\node_modules\\pnpm\\dist\\pnpm.cjs:49453:44)\n    at Object.default_1 [as default] (D:\\service\\Nvm\\v16.6.2\\node_global\\node_modules\\pnpm\\dist\\pnpm.cjs:49462:32)\n    at D:\\service\\Nvm\\v16.6.2\\node_global\\node_modules\\pnpm\\dist\\pnpm.cjs:129798:34"
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  "2 error pnpm": {
 | 
			
		||||
    "code": "ERR_PNPM_RECURSIVE_EXEC_FIRST_FAIL",
 | 
			
		||||
    "prefix": "D:\\layui-vue",
 | 
			
		||||
    "err": {
 | 
			
		||||
      "name": "pnpm",
 | 
			
		||||
      "message": "not found: insta",
 | 
			
		||||
      "code": "ERR_PNPM_RECURSIVE_EXEC_FIRST_FAIL",
 | 
			
		||||
      "stack": "Error: not found: insta\n    at getNotFoundError (D:\\service\\Nvm\\v16.6.2\\node_global\\node_modules\\pnpm\\dist\\pnpm.cjs:47811:51)\n    at Function.whichSync [as sync] (D:\\service\\Nvm\\v16.6.2\\node_global\\node_modules\\pnpm\\dist\\pnpm.cjs:47888:13)\n    at getCommandAbsolutePathSync (D:\\service\\Nvm\\v16.6.2\\node_global\\node_modules\\pnpm\\dist\\pnpm.cjs:49453:44)\n    at Object.default_1 [as default] (D:\\service\\Nvm\\v16.6.2\\node_global\\node_modules\\pnpm\\dist\\pnpm.cjs:49462:32)\n    at D:\\service\\Nvm\\v16.6.2\\node_global\\node_modules\\pnpm\\dist\\pnpm.cjs:129798:34"
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
@ -16,4 +16,28 @@ export default {
 | 
			
		||||
}
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
:::
 | 
			
		||||
 | 
			
		||||
::: demo
 | 
			
		||||
 | 
			
		||||
<template>
 | 
			
		||||
  <lay-collapse>
 | 
			
		||||
    <lay-collapse-item title="标题"> 内容 </lay-collapse-item>
 | 
			
		||||
    <lay-collapse-item title="标题"> 内容 </lay-collapse-item>
 | 
			
		||||
    <lay-collapse-item title="标题"> 内容 </lay-collapse-item>
 | 
			
		||||
  </lay-collapse>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import { ref } from 'vue'
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
  setup() {
 | 
			
		||||
 | 
			
		||||
    return {
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
:::
 | 
			
		||||
@ -17,7 +17,6 @@ h5 {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
h1,
 | 
			
		||||
h2,
 | 
			
		||||
h3,
 | 
			
		||||
h4,
 | 
			
		||||
h5,
 | 
			
		||||
@ -28,7 +27,6 @@ h6 {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
h1,
 | 
			
		||||
h2,
 | 
			
		||||
h3,
 | 
			
		||||
h4,
 | 
			
		||||
h5,
 | 
			
		||||
@ -64,17 +62,8 @@ h1 {
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
h2 {
 | 
			
		||||
  margin-top: 2.25rem;
 | 
			
		||||
  margin-bottom: 1.25rem;
 | 
			
		||||
  border-bottom: 1px solid var(--c-divider);
 | 
			
		||||
  padding-bottom: 0.3rem;
 | 
			
		||||
  line-height: 1.25;
 | 
			
		||||
  font-size: 1.65rem;
 | 
			
		||||
  /* overflow-x: auto; */
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
h2 + h3 {
 | 
			
		||||
h3 {
 | 
			
		||||
  margin-top: 1.5rem;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -99,19 +88,6 @@ h1 {
 | 
			
		||||
  line-height: 38px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
h2 {
 | 
			
		||||
  margin-top: 4px !important;
 | 
			
		||||
  margin-bottom: 16px !important;
 | 
			
		||||
  color: #000000d9 !important;
 | 
			
		||||
  font-weight: 500 !important;
 | 
			
		||||
  font-size: 16px !important;
 | 
			
		||||
  border-bottom: 0px;
 | 
			
		||||
  font-family: Avenir, -apple-system, BlinkMacSystemFont, segoe ui, Roboto,
 | 
			
		||||
    helvetica neue, Arial, noto sans, sans-serif, apple color emoji,
 | 
			
		||||
    segoe ui emoji, segoe ui symbol, noto color emoji, sans-serif;
 | 
			
		||||
  line-height: 38px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
p,
 | 
			
		||||
ol,
 | 
			
		||||
ul {
 | 
			
		||||
 | 
			
		||||
@ -27,6 +27,7 @@ import LayTimelineItem from "./module/timelineItem/index"
 | 
			
		||||
import LayTextarea from "./module/textarea/index"
 | 
			
		||||
import LaySwitch from "./module/switch/index"
 | 
			
		||||
import LayCollapse from "./module/collapse/index"
 | 
			
		||||
import LayCollapseItem  from "./module/collapseItem/index"
 | 
			
		||||
import LayContainer from "./module/container/index"
 | 
			
		||||
import LayMenu from './module/menu/index'
 | 
			
		||||
import LayMenuItem from './module/menuItem/index'
 | 
			
		||||
@ -62,6 +63,7 @@ const components: Record<string, IDefineComponent> = {
 | 
			
		||||
  LayTextarea,
 | 
			
		||||
  LaySwitch,
 | 
			
		||||
  LayCollapse,
 | 
			
		||||
  LayCollapseItem,
 | 
			
		||||
  LayContainer,
 | 
			
		||||
  LayMenu,
 | 
			
		||||
  LayMenuItem,
 | 
			
		||||
@ -108,6 +110,7 @@ export {
 | 
			
		||||
  LayTextarea,
 | 
			
		||||
  LaySwitch,
 | 
			
		||||
  LayCollapse,
 | 
			
		||||
  LayCollapseItem,
 | 
			
		||||
  LayContainer,
 | 
			
		||||
  LayMenu,
 | 
			
		||||
  LayMenuItem,
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										9
									
								
								src/module/collapseItem/index.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								src/module/collapseItem/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 || 'LayCollapseItem', Component)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export default Component as IDefineComponent
 | 
			
		||||
							
								
								
									
										21
									
								
								src/module/collapseItem/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								src/module/collapseItem/index.vue
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,21 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="layui-colla-item">
 | 
			
		||||
    <h2 class="layui-colla-title">
 | 
			
		||||
      {{ title }}<i class="layui-icon layui-colla-icon"></i>
 | 
			
		||||
    </h2>
 | 
			
		||||
    <div class="layui-colla-content layui-show">
 | 
			
		||||
      <p>
 | 
			
		||||
        <slot></slot>
 | 
			
		||||
      </p>
 | 
			
		||||
    </div>
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script setup name="LayCollapseItem" lang="ts">
 | 
			
		||||
import { defineProps } from 'vue'
 | 
			
		||||
 | 
			
		||||
const props =
 | 
			
		||||
  defineProps<{
 | 
			
		||||
    title?: string
 | 
			
		||||
  }>()
 | 
			
		||||
</script>
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user