init
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,12 @@
|
||||
export function nextId() {
|
||||
var s: any = [];
|
||||
var hexDigits = "0123456789abcdef";
|
||||
for (var i = 0; i < 36; i++) {
|
||||
s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);
|
||||
}
|
||||
s[14] = "4";
|
||||
s[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1);
|
||||
s[8] = s[13] = s[18] = s[23] = "-";
|
||||
var uuid = s.join("");
|
||||
return uuid;
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1,7 @@
|
||||
export declare type ButtonType = "primary" | "normal" | "warm" | "danger";
|
||||
export declare type ButtonSize = "lg" | "md" | "sm" | "xs";
|
||||
export declare type ButtonBorder = "green" | "blue" | "orange" | "red" | "black";
|
||||
export declare type ButtonNativeType = "button" | "submit" | "reset";
|
||||
export declare const ButtonEmits: {
|
||||
click: (evt: MouseEvent) => boolean;
|
||||
};
|
||||
@@ -0,0 +1,96 @@
|
||||
::: anchor
|
||||
:::
|
||||
|
||||
::: title 基本介绍
|
||||
:::
|
||||
|
||||
::: describe 使用锚点,可以将内容固定在容器内,并且不随容器的滚动而滚动,常用于侧边菜单导航等。
|
||||
:::
|
||||
|
||||
::: title 基础使用
|
||||
:::
|
||||
|
||||
::: demo 使用 `lay-affix` 标签, 创建锚点,`target` 属性用于需要监听其滚动事件的元素,默认为 `document.body` ,`offset`设置距离容器的偏移量
|
||||
<template>
|
||||
<div style="width:100%;height:200px">
|
||||
<lay-affix :target="target" v-if="target">
|
||||
<lay-button type="normal">固定在最顶部</lay-button>
|
||||
</lay-affix>
|
||||
<lay-affix :target="target" :offset="38" v-if="target" style="margin-left:150px;">
|
||||
<lay-button type="normal">固定在距离顶部38px</lay-button>
|
||||
</lay-affix>
|
||||
<lay-affix :target="target" :offset="76" v-if="target" style="margin-left:350px">
|
||||
<lay-button type="normal">固定在距离顶部76px</lay-button>
|
||||
</lay-affix>
|
||||
<lay-affix :target="target" :offset="114" v-if="target" style="margin-left:550px">
|
||||
<lay-button type="normal">固定在距离顶部114px</lay-button>
|
||||
</lay-affix>
|
||||
<lay-affix :target="target" :offset="152" v-if="target" style="margin-left:750px">
|
||||
<lay-button type="normal">固定在距离顶部152px</lay-button>
|
||||
</lay-affix>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { nextTick,ref } from 'vue'
|
||||
const target=ref()
|
||||
nextTick(()=>{
|
||||
target.value=document.querySelector(".layui-body");
|
||||
})
|
||||
const color=ref(0)
|
||||
const scroll=(e)=>{
|
||||
color.value=e.offset*2
|
||||
}
|
||||
</script>
|
||||
:::
|
||||
|
||||
::: title 固定在最底部
|
||||
:::
|
||||
|
||||
::: demo 使用 `position` 属性, 改变定位属性,默认为 `top`,可选值 `bottom`
|
||||
<template>
|
||||
<div style="width:100%;height:100px">
|
||||
<lay-affix :target="target" :offset="0" position="bottom" v-if="target">
|
||||
<lay-button type="normal">固定在最底部</lay-button>
|
||||
</lay-affix>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { nextTick,ref } from 'vue'
|
||||
const target=ref()
|
||||
nextTick(()=>{
|
||||
target.value=document.querySelector(".layui-body");
|
||||
})
|
||||
</script>
|
||||
:::
|
||||
|
||||
::: title Aiffx 属性
|
||||
:::
|
||||
|
||||
::: table
|
||||
|
||||
| 属性 | 描述 | 可选值 |
|
||||
| ------ | --------------------- | --------------------------------------- |
|
||||
| position | 定位属性 : string | `top` `bottom` |
|
||||
| offset | 偏移量 : number,默认为0 | - |
|
||||
| target | 指定参考容器 : HTMLElement | 默认`document.body`,请务必确保能够正确获取到dom|
|
||||
|
||||
:::
|
||||
|
||||
::: title Aiffx 事件
|
||||
:::
|
||||
|
||||
::: table
|
||||
|
||||
| 属性 | 描述 | 回调参数 |
|
||||
| ------ | --------------------- | --------------------------------------- |
|
||||
| scroll | 初始化完成与滚动时触发的回调,回调会返回一个object<br><br>`{targetScroll:string,affixed:boolean,offset:number}` |<br/>`targetScroll` 容器滚动距离<br/><br/>`affixed` 是否处于fixed状态<br/><br/>`offset` 与原本位置的距离 <br> |
|
||||
|
||||
:::
|
||||
|
||||
::: contributor affix
|
||||
:::
|
||||
|
||||
::: previousNext affix
|
||||
:::
|
||||
Binary file not shown.
@@ -0,0 +1,15 @@
|
||||
<script lang="ts">
|
||||
export default {
|
||||
name: "LayButtonContainer",
|
||||
};
|
||||
</script>
|
||||
|
||||
<script setup lang="ts">
|
||||
import "./index.less";
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="layui-btn-container">
|
||||
<slot></slot>
|
||||
</div>
|
||||
</template>
|
||||
@@ -0,0 +1,16 @@
|
||||
<script lang="ts">
|
||||
export default {
|
||||
name: "TipsIcon",
|
||||
};
|
||||
</script>
|
||||
<script setup lang="ts">
|
||||
import LayIcon from "../component/icon/index";
|
||||
|
||||
const props = defineProps<{
|
||||
color?: string;
|
||||
size?: string;
|
||||
}>();
|
||||
</script>
|
||||
<template>
|
||||
<lay-icon :color="props.color" :size="props.size" type="layui-icon-tips" />
|
||||
</template>
|
||||
Reference in New Issue
Block a user