(button): 新增 loading-icon 属性, 允许自定义加载图标

This commit is contained in:
就眠儀式
2022-08-07 02:32:47 +08:00
parent 0058721468
commit 06d109dcef
4 changed files with 24 additions and 20 deletions

View File

@@ -22,6 +22,7 @@ export interface LayButtonProps {
size?: ButtonSize;
prefixIcon?: String;
suffixIcon?: String;
loadingIcon?: String;
border?: ButtonBorder;
fluid?: BooleanOrString;
radius?: BooleanOrString;
@@ -36,6 +37,7 @@ const props = withDefaults(defineProps<LayButtonProps>(), {
radius: false,
loading: false,
disabled: false,
loadingIcon: "layui-icon-loading-one",
nativeType: "button",
borderStyle: "soild",
});
@@ -79,7 +81,8 @@ const classes = computed(() => {
<i v-if="prefixIcon" :class="`layui-icon ${prefixIcon}`"></i>
<i
v-if="loading"
class="layui-icon layui-icon-loading-one layui-anim layui-anim-rotate layui-anim-loop"
:class="loadingIcon"
class="layui-icon layui-anim layui-anim-rotate layui-anim-loop"
></i>
<slot v-else></slot>
<i v-if="suffixIcon" :class="`layui-icon ${suffixIcon}`"></i>

View File

@@ -24,10 +24,6 @@ export interface LayPageProps {
limits?: number[];
}
const slots = useSlots();
const { t } = useI18n();
const props = withDefaults(defineProps<LayPageProps>(), {
limit: 10,
theme: "green",
@@ -42,6 +38,9 @@ const props = withDefaults(defineProps<LayPageProps>(), {
limits: () => [10, 20, 30, 40, 50],
});
const { t } = useI18n();
const slots = useSlots();
const limits = ref(props.limits);
const pages = Math.floor(props.pages / 2);

View File

@@ -58,7 +58,7 @@ const props = withDefaults(defineProps<LayTableProps>(), {
childrenColumnName: "children",
dataSource: () => [],
selectedKeys: () => [],
selectedKey: '',
selectedKey: "",
maxHeight: "auto",
even: false,
rowClassName: "",