init
This commit is contained in:
@@ -0,0 +1,109 @@
|
||||
::: anchor
|
||||
:::
|
||||
|
||||
::: title 基本介绍
|
||||
:::
|
||||
|
||||
::: describe 如果页面的路径比较简单,则使用页头组件要比面包屑更直观一点。
|
||||
:::
|
||||
|
||||
::: title 基础使用
|
||||
:::
|
||||
|
||||
::: demo 使用 `lay-page-header` 标签
|
||||
|
||||
<template>
|
||||
<lay-page-header content="详情页面" @back="handleBack"></lay-page-header>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
const handleBack=()=>{
|
||||
alert('点击返回回调')
|
||||
}
|
||||
</script>
|
||||
|
||||
:::
|
||||
|
||||
::: title 设置标题
|
||||
:::
|
||||
|
||||
::: demo 使用 `backText` 属性 自定义返回文本
|
||||
|
||||
<template>
|
||||
<lay-page-header content="详情页面" backText="back" @back="handleBack"></lay-page-header>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
const handleBack=()=>{
|
||||
alert('点击返回回调')
|
||||
}
|
||||
</script>
|
||||
|
||||
:::
|
||||
|
||||
::: title 使用插槽
|
||||
:::
|
||||
|
||||
::: demo 使用 默认插槽可以自定义右侧内容 同时content属性将失效
|
||||
|
||||
<template>
|
||||
<lay-page-header backText="back" @back="handleBack">
|
||||
<span>Do what ever you want...</span>
|
||||
<lay-icon type="layui-icon-face-smile" color="red"></lay-icon>
|
||||
<lay-icon type="layui-icon-face-smile" color="orange"></lay-icon>
|
||||
<lay-icon type="layui-icon-face-smile" color="green"></lay-icon>
|
||||
<lay-icon type="layui-icon-face-smile" color="cyan"></lay-icon>
|
||||
<lay-icon type="layui-icon-face-smile" color="blue"></lay-icon>
|
||||
<lay-icon type="layui-icon-face-smile" color="black"></lay-icon>
|
||||
</lay-page-header>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
const handleBack=()=>{
|
||||
alert('点击返回回调')
|
||||
}
|
||||
</script>
|
||||
|
||||
:::
|
||||
|
||||
::: title PageHeader 属性
|
||||
:::
|
||||
|
||||
::: table
|
||||
|
||||
| 属性 | 描述 | 可选值 |
|
||||
| ------ | ---- | -------------- |
|
||||
| content| 标题,当前默认插槽不为空时失效 | -- |
|
||||
| backText| 返回文本 | 默认 "返回" |
|
||||
| backIcon| 返回图标 | 内置图标集 |
|
||||
:::
|
||||
|
||||
::: title PageHeader 事件
|
||||
:::
|
||||
|
||||
::: table
|
||||
|
||||
| 属性 | 描述 |
|
||||
| ------ | ---- |
|
||||
| back| 点击返回回调 |
|
||||
|
||||
:::
|
||||
|
||||
::: title PageHeader 插槽
|
||||
:::
|
||||
|
||||
::: table
|
||||
|
||||
| 属性 | 描述 |
|
||||
| ------ | ---- |
|
||||
| default | 标题内容 |
|
||||
| backIcon| 返回图标 |
|
||||
|
||||
:::
|
||||
|
||||
|
||||
::: contributor pageHeader
|
||||
:::
|
||||
|
||||
::: previousNext pageHeader
|
||||
:::
|
||||
@@ -0,0 +1,59 @@
|
||||
<script lang="ts">
|
||||
export default {
|
||||
name: "LayCheckboxGroup",
|
||||
};
|
||||
</script>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { provide, ref, watch } from "vue";
|
||||
import { Recordable } from "../../types";
|
||||
|
||||
export interface CheckboxGroupProps {
|
||||
modelValue?: Recordable[];
|
||||
disabled?: boolean;
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<CheckboxGroupProps>(), {
|
||||
modelValue: () => [],
|
||||
disabled: false,
|
||||
});
|
||||
|
||||
const emit = defineEmits(["update:modelValue", "change"]);
|
||||
|
||||
const modelValue = ref(props.modelValue);
|
||||
const disabled = ref(props.disabled);
|
||||
|
||||
provide("checkboxGroup", {
|
||||
name: "LayCheckboxGroup",
|
||||
modelValue: modelValue,
|
||||
disabled: disabled,
|
||||
});
|
||||
|
||||
watch(
|
||||
() => modelValue,
|
||||
(val) => {
|
||||
emit("change", modelValue.value);
|
||||
emit("update:modelValue", modelValue.value);
|
||||
},
|
||||
{ deep: true }
|
||||
);
|
||||
|
||||
watch(
|
||||
() => props.modelValue,
|
||||
(val) => (modelValue.value = val)
|
||||
);
|
||||
|
||||
watch(
|
||||
() => props.disabled,
|
||||
(val) => (disabled.value = val)
|
||||
);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div
|
||||
class="layui-checkbox-group"
|
||||
:class="{ 'layui-checkbox-group-disabled': disabled }"
|
||||
>
|
||||
<slot></slot>
|
||||
</div>
|
||||
</template>
|
||||
Binary file not shown.
@@ -0,0 +1,127 @@
|
||||
@import "../button/index.less";
|
||||
@import "../checkbox/index.less";
|
||||
|
||||
:root {
|
||||
--transfer-box-border-radius: var(--global-border-radius);
|
||||
}
|
||||
|
||||
.layui-transfer {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.layui-transfer .layui-btn + .layui-btn {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.layui-transfer-box,
|
||||
.layui-transfer-header,
|
||||
.layui-transfer-search {
|
||||
border-width: 0;
|
||||
border-style: solid;
|
||||
border-color: #eee;
|
||||
}
|
||||
|
||||
.layui-transfer-box {
|
||||
position: relative;
|
||||
border-width: 1px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
border-radius: var(--transfer-box-border-radius);
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.layui-transfer-box .layui-form-checkbox {
|
||||
width: 100%;
|
||||
margin: 0 !important;
|
||||
}
|
||||
|
||||
.layui-transfer-header {
|
||||
height: 38px;
|
||||
line-height: 38px;
|
||||
padding: 0 10px;
|
||||
border-bottom-width: 1px;
|
||||
flex: 0;
|
||||
}
|
||||
|
||||
.layui-transfer-search {
|
||||
position: relative;
|
||||
padding: 10px;
|
||||
border-bottom-width: 1px;
|
||||
flex: 0;
|
||||
}
|
||||
|
||||
.layui-transfer-search .layui-input {
|
||||
height: 35px;
|
||||
padding-left: 2px;
|
||||
font-size: 13px;
|
||||
letter-spacing: 1px;
|
||||
}
|
||||
|
||||
.layui-transfer-search .layui-icon-search {
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.layui-transfer-active {
|
||||
margin: 0 15px;
|
||||
}
|
||||
|
||||
.layui-transfer-active .layui-btn {
|
||||
display: block;
|
||||
margin: 0;
|
||||
padding: 0 15px;
|
||||
background-color: #5fb878;
|
||||
border-color: #5fb878;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.layui-transfer-active .layui-btn-disabled {
|
||||
background-color: #fbfbfb;
|
||||
border-color: #eee;
|
||||
color: #d2d2d2;
|
||||
}
|
||||
|
||||
.layui-transfer-active .layui-btn:first-child {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
.layui-transfer-active .layui-btn .layui-icon {
|
||||
margin: 0;
|
||||
font-size: 14px !important;
|
||||
}
|
||||
|
||||
.layui-transfer-data {
|
||||
padding: 5px 0;
|
||||
overflow: auto;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.layui-transfer-data li {
|
||||
height: 32px;
|
||||
line-height: 32px;
|
||||
padding: 0 10px;
|
||||
}
|
||||
|
||||
.layui-transfer-data li:hover {
|
||||
background-color: #f6f6f6;
|
||||
transition: 0.5s all;
|
||||
}
|
||||
|
||||
.layui-transfer-data .layui-none {
|
||||
padding: 15px 10px;
|
||||
text-align: center;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.layui-transfer-active {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-items: center;
|
||||
}
|
||||
|
||||
.layui-transfer-footer {
|
||||
flex: 0;
|
||||
height: 38px;
|
||||
line-height: 38px;
|
||||
border-top: 1px solid #eee;
|
||||
padding: 0 10px;
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1,19 @@
|
||||
import { w as withInstall } from "../badge/index2.js";
|
||||
import { defineComponent, openBlock, createElementBlock, renderSlot } from "vue";
|
||||
var index = /* @__PURE__ */ (() => ".layui-logo{left:0;top:0;width:200px;height:60px;line-height:60px;text-align:center;color:var(--global-primary-color);font-size:16px}\n")();
|
||||
const _hoisted_1 = { class: "layui-logo" };
|
||||
const __default__ = {
|
||||
name: "LayLogo"
|
||||
};
|
||||
const _sfc_main = /* @__PURE__ */ defineComponent({
|
||||
...__default__,
|
||||
setup(__props) {
|
||||
return (_ctx, _cache) => {
|
||||
return openBlock(), createElementBlock("div", _hoisted_1, [
|
||||
renderSlot(_ctx.$slots, "default")
|
||||
]);
|
||||
};
|
||||
}
|
||||
});
|
||||
const component = withInstall(_sfc_main);
|
||||
export { component as default };
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,28 @@
|
||||
export function throttle(func: Function) {
|
||||
let timer: any = null;
|
||||
return function (args: any) {
|
||||
if (!timer) {
|
||||
timer = setTimeout(() => {
|
||||
timer = null;
|
||||
func(args);
|
||||
}, 30);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export function handle_select(e: Event): void {
|
||||
e.preventDefault();
|
||||
}
|
||||
|
||||
export function makeDots(props: any) {
|
||||
if (props.step === 0) return [];
|
||||
let val = 0;
|
||||
let dots = [0];
|
||||
let count = Math.floor(100 / props.step) - 1;
|
||||
for (let i = 0; i < count; i++) {
|
||||
val += props.step;
|
||||
dots.push(val);
|
||||
}
|
||||
dots.push(100);
|
||||
return dots;
|
||||
}
|
||||
Reference in New Issue
Block a user