✨(component): 新增 pageHeader 组件 backIcon 属性, 修复 select 组件 label 为 null 时的搜索问题
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="lay-page-header">
|
||||
<div class="lay-page-header__left" @click="emits('back')">
|
||||
<i class="layui-icon layui-icon-return"></i>
|
||||
<i class="layui-icon" :class="[ backIcon ]"></i>
|
||||
<div class="lay-page-header__title">{{ backText }}</div>
|
||||
</div>
|
||||
<div class="lay-page-header__content">
|
||||
@@ -23,10 +23,12 @@ import "./index.less";
|
||||
export interface PageHeaderProps {
|
||||
content?: string;
|
||||
backText?: string;
|
||||
backIcon?: string;
|
||||
}
|
||||
const props = withDefaults(defineProps<PageHeaderProps>(), {
|
||||
content: "",
|
||||
backText: "返回",
|
||||
backIcon: "layui-icon-return"
|
||||
});
|
||||
|
||||
const emits = defineEmits(["back"]);
|
||||
|
||||
@@ -12,8 +12,7 @@ import {
|
||||
inject,
|
||||
WritableComputedRef,
|
||||
Ref,
|
||||
onMounted,
|
||||
useSlots,
|
||||
onMounted
|
||||
} from "vue";
|
||||
|
||||
export interface SelectOptionProps {
|
||||
@@ -67,8 +66,8 @@ const select = () => {
|
||||
|
||||
const display = computed(() => {
|
||||
return (
|
||||
props.keyword.toString().indexOf(searchValue.value) > -1 ||
|
||||
props.label.toString().indexOf(searchValue.value) > -1
|
||||
props.keyword?.toString().indexOf(searchValue.value) > -1 ||
|
||||
props.label?.toString().indexOf(searchValue.value) > -1
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user