⚡️(icon-picker): update
This commit is contained in:
parent
0eaac32664
commit
b72212b659
@ -13,11 +13,11 @@ export interface LayEmptyProps {
|
|||||||
image?: string;
|
image?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const slots = useSlots();
|
|
||||||
|
|
||||||
const props = withDefaults(defineProps<LayEmptyProps>(), {
|
const props = withDefaults(defineProps<LayEmptyProps>(), {
|
||||||
description: "暂无数据",
|
description: "暂无数据",
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const slots = useSlots();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -8,12 +8,11 @@ export default {
|
|||||||
import "./index.less";
|
import "./index.less";
|
||||||
import { useSlots } from "vue";
|
import { useSlots } from "vue";
|
||||||
|
|
||||||
const slot = useSlots();
|
|
||||||
|
|
||||||
export interface LayFieldProps {
|
export interface LayFieldProps {
|
||||||
title?: string;
|
title?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const slot = useSlots();
|
||||||
const props = defineProps<LayFieldProps>();
|
const props = defineProps<LayFieldProps>();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@ -24,7 +23,6 @@ const props = defineProps<LayFieldProps>();
|
|||||||
<slot></slot>
|
<slot></slot>
|
||||||
</div>
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
<fieldset v-else class="layui-field layui-field-title">
|
<fieldset v-else class="layui-field layui-field-title">
|
||||||
<legend>
|
<legend>
|
||||||
<a name="docend">{{ title }}</a>
|
<a name="docend">{{ title }}</a>
|
||||||
|
@ -37,7 +37,6 @@ const icones: Ref = ref([]);
|
|||||||
const total = ref(icons.length);
|
const total = ref(icons.length);
|
||||||
const totalPage = ref(total.value / 12);
|
const totalPage = ref(total.value / 12);
|
||||||
const currentPage: Ref = ref(1);
|
const currentPage: Ref = ref(1);
|
||||||
const searchValue = ref();
|
|
||||||
|
|
||||||
if (props.page) {
|
if (props.page) {
|
||||||
icones.value = icons.slice(0, 12);
|
icones.value = icons.slice(0, 12);
|
||||||
@ -45,7 +44,7 @@ if (props.page) {
|
|||||||
icones.value = icons;
|
icones.value = icons;
|
||||||
}
|
}
|
||||||
|
|
||||||
const next = function () {
|
const next = () => {
|
||||||
if (currentPage.value === totalPage.value) {
|
if (currentPage.value === totalPage.value) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -55,7 +54,7 @@ const next = function () {
|
|||||||
icones.value = icons.slice(start, end);
|
icones.value = icons.slice(start, end);
|
||||||
};
|
};
|
||||||
|
|
||||||
const prev = function () {
|
const prev = () => {
|
||||||
if (currentPage.value === 1) {
|
if (currentPage.value === 1) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -77,7 +76,7 @@ const clear = () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const search = function (e: any) {
|
const search = (e: any) => {
|
||||||
currentPage.value = 1;
|
currentPage.value = 1;
|
||||||
const start = (currentPage.value - 1) * 12;
|
const start = (currentPage.value - 1) * 12;
|
||||||
const end = start + 12;
|
const end = start + 12;
|
||||||
@ -101,7 +100,7 @@ const search = function (e: any) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const searchList = function (str: string, container: any) {
|
const searchList = (str: string, container: any) => {
|
||||||
var newList = [];
|
var newList = [];
|
||||||
var startChar = str.charAt(0);
|
var startChar = str.charAt(0);
|
||||||
var strLen = str.length;
|
var strLen = str.length;
|
||||||
@ -152,7 +151,6 @@ const searchList = function (str: string, container: any) {
|
|||||||
<lay-input
|
<lay-input
|
||||||
@input="search"
|
@input="search"
|
||||||
@clear="clear"
|
@clear="clear"
|
||||||
v-model="searchValue"
|
|
||||||
:autocomplete="true"
|
:autocomplete="true"
|
||||||
:allow-clear="true"
|
:allow-clear="true"
|
||||||
>
|
>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user