docs: 更新日志, 修复文档细节
This commit is contained in:
		
							parent
							
								
									da148ac779
								
							
						
					
					
						commit
						9e9efec10c
					
				@ -30,27 +30,6 @@ export default {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
:::
 | 
					:::
 | 
				
			||||||
 | 
					
 | 
				
			||||||
::: title 主题配置
 | 
					 | 
				
			||||||
:::
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
<p style="margin-left: 30px">less</p>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
```
 | 
					 | 
				
			||||||
@panel-border-color: #eee;
 | 
					 | 
				
			||||||
@panel-border-radius: 2px;
 | 
					 | 
				
			||||||
@panel-fore-color: #333;
 | 
					 | 
				
			||||||
@panel-back-color: #fff;
 | 
					 | 
				
			||||||
```
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
<p style="margin-left: 30px">css</p>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
```
 | 
					 | 
				
			||||||
--panel-border-color: #eee;
 | 
					 | 
				
			||||||
--panel-border-radius: 2px;
 | 
					 | 
				
			||||||
--panel-fore-color: #333;
 | 
					 | 
				
			||||||
--panel-back-color: #fff;
 | 
					 | 
				
			||||||
```
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
::: title Panel 插槽
 | 
					::: title Panel 插槽
 | 
				
			||||||
:::
 | 
					:::
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -11,7 +11,19 @@
 | 
				
			|||||||
<template>
 | 
					<template>
 | 
				
			||||||
<lay-timeline>
 | 
					<lay-timeline>
 | 
				
			||||||
  <lay-timeline-item title="0.4.0">
 | 
					  <lay-timeline-item title="0.4.0">
 | 
				
			||||||
  <ul> 
 | 
					    <ul> 
 | 
				
			||||||
 | 
					      <a name="0-4-5"> </a> 
 | 
				
			||||||
 | 
					      <li> 
 | 
				
			||||||
 | 
					        <h3>0.4.4 <span class="layui-badge-rim">2022-03-29</span></h3> 
 | 
				
			||||||
 | 
					        <ul>
 | 
				
			||||||
 | 
					          <li>[新增] tab 组件 position 属性, 不同方向的选项卡标题。</li>
 | 
				
			||||||
 | 
					          <li>[修复] variable 全局变量重复导入的问题</li>
 | 
				
			||||||
 | 
					          <li>[支持] icon 列表复制。</li>
 | 
				
			||||||
 | 
					          <li>[支持] 夜间模式</li>
 | 
				
			||||||
 | 
					        </ul> 
 | 
				
			||||||
 | 
					      </li>
 | 
				
			||||||
 | 
					    </ul>
 | 
				
			||||||
 | 
					    <ul> 
 | 
				
			||||||
      <a name="0-4-4"> </a> 
 | 
					      <a name="0-4-4"> </a> 
 | 
				
			||||||
      <li> 
 | 
					      <li> 
 | 
				
			||||||
        <h3>0.4.4 <span class="layui-badge-rim">2022-03-29</span></h3> 
 | 
					        <h3>0.4.4 <span class="layui-badge-rim">2022-03-29</span></h3> 
 | 
				
			||||||
 | 
				
			|||||||
@ -345,8 +345,8 @@ export default {
 | 
				
			|||||||
  background-color: #f1f1f1!important;
 | 
					  background-color: #f1f1f1!important;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.layui-layout-document .layui-header .layui-nav .layui-nav-item > a,
 | 
					.layui-layout-document .layui-header .layui-nav .layui-nav-item  a,
 | 
				
			||||||
.layui-layout-document .layui-header .layui-nav .layui-nav-item > a:hover {
 | 
					.layui-layout-document .layui-header .layui-nav .layui-nav-item  a:hover {
 | 
				
			||||||
  color: rgba(0, 0, 0, 0.8);
 | 
					  color: rgba(0, 0, 0, 0.8);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -8,12 +8,15 @@ export default {
 | 
				
			|||||||
import "./index.less";
 | 
					import "./index.less";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export interface LayAvatarProps {
 | 
					export interface LayAvatarProps {
 | 
				
			||||||
  src?: String;
 | 
					  src?: string;
 | 
				
			||||||
  size?: string;
 | 
					  size?: 'xs' | 'sm' | 'md' | 'lg';
 | 
				
			||||||
  radius?: boolean;
 | 
					  radius?: boolean;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const props = withDefaults(defineProps<LayAvatarProps>(), {});
 | 
					const props = withDefaults(defineProps<LayAvatarProps>(), {
 | 
				
			||||||
 | 
					  size: 'md',
 | 
				
			||||||
 | 
					  radius: false
 | 
				
			||||||
 | 
					});
 | 
				
			||||||
</script>
 | 
					</script>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<template>
 | 
					<template>
 | 
				
			||||||
 | 
				
			|||||||
@ -6,25 +6,25 @@ export default {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
<script setup lang="ts">
 | 
					<script setup lang="ts">
 | 
				
			||||||
import "./index.less";
 | 
					import "./index.less";
 | 
				
			||||||
import { provide, ref, watch } from "vue";
 | 
					import { provide, ref } from "vue";
 | 
				
			||||||
import { onClickOutside } from "@vueuse/core";
 | 
					import { onClickOutside } from "@vueuse/core";
 | 
				
			||||||
 | 
					import { DropdownTrigger } from "./interface";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export interface LayDropdownProps {
 | 
					export interface LayDropdownProps {
 | 
				
			||||||
  trigger?: string;
 | 
					  trigger?: DropdownTrigger;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const dropdownRef = ref<null | HTMLElement>(null);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
const props = withDefaults(defineProps<LayDropdownProps>(), {
 | 
					const props = withDefaults(defineProps<LayDropdownProps>(), {
 | 
				
			||||||
  trigger: "click",
 | 
					  trigger: "click",
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const openState = ref(false);
 | 
				
			||||||
 | 
					const dropdownRef = ref<null | HTMLElement>(null);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
onClickOutside(dropdownRef, (event) => {
 | 
					onClickOutside(dropdownRef, (event) => {
 | 
				
			||||||
  openState.value = false;
 | 
					  openState.value = false;
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const openState = ref(false);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
const open = function () {
 | 
					const open = function () {
 | 
				
			||||||
  openState.value = true;
 | 
					  openState.value = true;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
				
			|||||||
@ -0,0 +1 @@
 | 
				
			|||||||
 | 
					export type DropdownTrigger = 'click' | 'hover';
 | 
				
			||||||
@ -5,12 +5,13 @@ export default {
 | 
				
			|||||||
</script>
 | 
					</script>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<script setup lang="ts">
 | 
					<script setup lang="ts">
 | 
				
			||||||
import { withDefaults } from "vue";
 | 
					 | 
				
			||||||
import "./index.less";
 | 
					import "./index.less";
 | 
				
			||||||
 | 
					import { withDefaults } from "vue";
 | 
				
			||||||
 | 
					import { String } from 'src/types';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export interface LayEmptyProps {
 | 
					export interface LayEmptyProps {
 | 
				
			||||||
  description?: string;
 | 
					  description?: String;
 | 
				
			||||||
  image?: string;
 | 
					  image?: String;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const props = withDefaults(defineProps<LayEmptyProps>(), {
 | 
					const props = withDefaults(defineProps<LayEmptyProps>(), {
 | 
				
			||||||
 | 
				
			|||||||
@ -6,25 +6,26 @@ export default {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
<script setup lang="ts">
 | 
					<script setup lang="ts">
 | 
				
			||||||
import "./index.less";
 | 
					import "./index.less";
 | 
				
			||||||
 | 
					import { useSlots } from "vue";
 | 
				
			||||||
import { useI18n } from "vue-i18n";
 | 
					import { useI18n } from "vue-i18n";
 | 
				
			||||||
import { computed, useSlots } from "vue-demi";
 | 
					import { Boolean, String } from 'src/types';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const { t } = useI18n();
 | 
					const { t } = useI18n();
 | 
				
			||||||
const slots = useSlots();
 | 
					const slots = useSlots();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export interface LayInputProps {
 | 
					export interface LayInputProps {
 | 
				
			||||||
  name?: string;
 | 
					  name?: String;
 | 
				
			||||||
  type?: string;
 | 
					  type?: String;
 | 
				
			||||||
  value?: string;
 | 
					  value?: String;
 | 
				
			||||||
  disabled?: boolean;
 | 
					  disabled?: Boolean;
 | 
				
			||||||
  modelValue?: string;
 | 
					  modelValue?: String;
 | 
				
			||||||
  placeholder?: string;
 | 
					  placeholder?: String;
 | 
				
			||||||
  allowClear?: boolean;
 | 
					  allowClear?: Boolean;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const props = withDefaults(defineProps<LayInputProps>(), {});
 | 
					const props = withDefaults(defineProps<LayInputProps>(), {});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const emit = defineEmits(["update:modelValue", "input", "focus", "blur"]);
 | 
					const emit = defineEmits(["update:modelValue", "input", "change", "focus", "blur"]);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const onInput = function (event: InputEvent) {
 | 
					const onInput = function (event: InputEvent) {
 | 
				
			||||||
  const inputElement = event.target as HTMLInputElement;
 | 
					  const inputElement = event.target as HTMLInputElement;
 | 
				
			||||||
@ -32,16 +33,20 @@ const onInput = function (event: InputEvent) {
 | 
				
			|||||||
  emit("input", event);
 | 
					  emit("input", event);
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const onFocus = function (event: FocusEvent) {
 | 
					const onClear = () => {
 | 
				
			||||||
 | 
					  emit("update:modelValue", "");
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const onFocus = (event: FocusEvent) => {
 | 
				
			||||||
  emit("focus", event);
 | 
					  emit("focus", event);
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const onBlur = function () {
 | 
					const onChange = () => {
 | 
				
			||||||
  emit("blur");
 | 
					  emit("change");
 | 
				
			||||||
};
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const clear = () => {
 | 
					const onBlur = () => {
 | 
				
			||||||
  emit("update:modelValue", "");
 | 
					  emit("blur");
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
</script>
 | 
					</script>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -61,12 +66,13 @@ const clear = () => {
 | 
				
			|||||||
      @input="onInput"
 | 
					      @input="onInput"
 | 
				
			||||||
      @focus="onFocus"
 | 
					      @focus="onFocus"
 | 
				
			||||||
      @blur="onBlur"
 | 
					      @blur="onBlur"
 | 
				
			||||||
 | 
					      @change="onChange"
 | 
				
			||||||
    />
 | 
					    />
 | 
				
			||||||
    <span class="layui-input-suffix" v-if="slots.suffix">
 | 
					    <span class="layui-input-suffix" v-if="slots.suffix">
 | 
				
			||||||
      <slot name="suffix"></slot>
 | 
					      <slot name="suffix"></slot>
 | 
				
			||||||
    </span>
 | 
					    </span>
 | 
				
			||||||
    <span class="layui-input-clear" v-if="allowClear">
 | 
					    <span class="layui-input-clear" v-if="allowClear">
 | 
				
			||||||
      <lay-icon type="layui-icon-close-fill" @click="clear"></lay-icon>
 | 
					      <lay-icon type="layui-icon-close-fill" @click="onClear"></lay-icon>
 | 
				
			||||||
    </span>
 | 
					    </span>
 | 
				
			||||||
  </div>
 | 
					  </div>
 | 
				
			||||||
</template>
 | 
					</template>
 | 
				
			||||||
 | 
				
			|||||||
@ -19,4 +19,11 @@
 | 
				
			|||||||
  border-color: @panel-border-color;
 | 
					  border-color: @panel-border-color;
 | 
				
			||||||
  background-color: @panel-back-color;
 | 
					  background-color: @panel-back-color;
 | 
				
			||||||
  color: @panel-fore-color;
 | 
					  color: @panel-fore-color;
 | 
				
			||||||
 | 
					  .is-hover-shadow:hover {
 | 
				
			||||||
 | 
					    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					  .shadow {
 | 
				
			||||||
 | 
					    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					  
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -6,10 +6,27 @@ export default {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
<script setup lang="ts">
 | 
					<script setup lang="ts">
 | 
				
			||||||
import "./index.less";
 | 
					import "./index.less";
 | 
				
			||||||
 | 
					import {computed} from "vue";
 | 
				
			||||||
 | 
					import {PanelShadow} from "./interface";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export interface LayPanelProps {
 | 
				
			||||||
 | 
					  shadow?: PanelShadow;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const props = withDefaults(defineProps<LayPanelProps>(), {
 | 
				
			||||||
 | 
					  shadow: "always",
 | 
				
			||||||
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const classes = computed(() => {
 | 
				
			||||||
 | 
					  return {
 | 
				
			||||||
 | 
					    shadow: props.shadow === "always",
 | 
				
			||||||
 | 
					    "is-hover-shadow": props.shadow === "hover",
 | 
				
			||||||
 | 
					  };
 | 
				
			||||||
 | 
					});
 | 
				
			||||||
</script>
 | 
					</script>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<template>
 | 
					<template>
 | 
				
			||||||
  <div class="layui-panel">
 | 
					  <div class="layui-panel" :class="classes">
 | 
				
			||||||
    <slot></slot>
 | 
					    <slot></slot>
 | 
				
			||||||
  </div>
 | 
					  </div>
 | 
				
			||||||
</template>
 | 
					</template>
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										1
									
								
								src/component/panel/interface.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								src/component/panel/interface.ts
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1 @@
 | 
				
			|||||||
 | 
					export type PanelShadow = "always" | "hover" | "never";
 | 
				
			||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user