(component):

This commit is contained in:
就眠儀式 2022-09-28 22:55:53 +08:00
parent 62397afdd7
commit 46953e9a30
5 changed files with 13 additions and 10 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "@layui/layui-vue", "name": "@layui/layui-vue",
"version": "1.4.14", "version": "1.5.0-alpha.2",
"author": "就眠儀式", "author": "就眠儀式",
"license": "MIT", "license": "MIT",
"description": "a component library for Vue 3 base on layui-vue", "description": "a component library for Vue 3 base on layui-vue",

View File

@ -44,6 +44,7 @@ const matchModule: string[] = [
"dropdownMenuItem", "dropdownMenuItem",
"tag", "tag",
"tagInput", "tagInput",
"footer"
]; ];
export default (): UserConfigExport => { export default (): UserConfigExport => {

View File

@ -44,6 +44,7 @@ export interface LaySelectProps {
export interface SelectEmits { export interface SelectEmits {
(e: "update:modelValue", value: string): void; (e: "update:modelValue", value: string): void;
(e: "change", value: string): void; (e: "change", value: string): void;
(e: "search", value: string): void;
} }
const props = withDefaults(defineProps<LaySelectProps>(), { const props = withDefaults(defineProps<LaySelectProps>(), {
@ -115,9 +116,9 @@ const selectedValue = computed({
get() { get() {
return props.modelValue; return props.modelValue;
}, },
set(val) { set(value) {
emits("update:modelValue", val); emits("update:modelValue", value);
emits("change", val); emits("change", value);
}, },
}); });
@ -126,6 +127,7 @@ const multiple = computed(() => {
}); });
const handleSearch = (value: string) => { const handleSearch = (value: string) => {
emits("search", value);
searchValue.value = value; searchValue.value = value;
}; };

View File

@ -253,9 +253,10 @@ export default {
| disabled | 是否禁用 | `boolean` | `true` `false` | `false` | | disabled | 是否禁用 | `boolean` | `true` `false` | `false` |
| showEmpty | 是否增加空提示选项 | `boolean` | `true` `false` | `true` | | showEmpty | 是否增加空提示选项 | `boolean` | `true` `false` | `true` |
| multiple | 是否为多选 | `boolean` | `true` `false` | `false` | | multiple | 是否为多选 | `boolean` | `true` `false` | `false` |
| create | 是否允许创建 | `boolean` | `true` `false` | `false` | | size | 尺寸 | `string` | `lg` `md` `sm` `xs`| `md` |
| size | 尺寸 | `string` | `lg` `md` `sm` `xs`| `md` | | searchPlaceholder | 搜索提示 | `string` | -- | -- |
| minCollapsedNum | 多选模式最小折叠数量 | `number` | -- | -- |
| collapseTagsTooltip | 多选折叠后时候悬浮展示 | `boolean` | -- | -- |
::: :::
@ -268,7 +269,6 @@ export default {
| ------ | ---------- | --------------- | | ------ | ---------- | --------------- |
| change | 切换事件 | value | | change | 切换事件 | value |
| search | 关键词变化事件 | 用户输入的关键词 string | | search | 关键词变化事件 | 用户输入的关键词 string |
| create | 允许创建情况下的创建回调事件 | 用户输入的关键词 string |
::: :::
@ -284,7 +284,7 @@ export default {
| ------------ | --------------------- | ------------------------- | -------------- | -------- | | ------------ | --------------------- | ------------------------- | -------------- | -------- |
| label | 标签值(`必填`) | `string` | - | - | | label | 标签值(`必填`) | `string` | - | - |
| value | 值 | `string` / `number` | - | - | | value | 值 | `string` / `number` | - | - |
| keyword | 用于匹配关键词的数据,传入文本+拼音可以支持拼音搜索 | `string` | - | - | | keyword | 用于匹配关键词的数据,传入文本+拼音可以支持拼音搜索 | `string` | - | - |
| disabled | 是否禁用 | `boolean` | `true` `false` | `false` | | disabled | 是否禁用 | `boolean` | `true` `false` | `false` |
::: :::

View File

@ -38,7 +38,7 @@
<li>[优化] tag 组件 border background height 等, 使其更贴合 layui 的设计规范。</li> <li>[优化] tag 组件 border background height 等, 使其更贴合 layui 的设计规范。</li>
<li>[优化] input 组件 suffix prefix password clear 左右布局, 由 15px 调整至 10px。</li> <li>[优化] input 组件 suffix prefix password clear 左右布局, 由 15px 调整至 10px。</li>
<li>[优化] input 组件 prefix 与 prefix-icon 存在时, 取消左侧边距缩进。</li> <li>[优化] input 组件 prefix 与 prefix-icon 存在时, 取消左侧边距缩进。</li>
<li>[删除] select 组件 create 属性。</li> <li>[删除] select 组件 create 属性 与 create 事件</li>
</ul> </ul>
</li> </li>
</ul> </ul>