Skip to content

Commit 813fd2d

Browse files
committed
升级2.0.0
1 parent c6432f6 commit 813fd2d

15 files changed

+1529
-1023
lines changed

.eslintignore

-4
This file was deleted.

.eslintrc.cjs

-52
This file was deleted.

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
## Changelog
22

3+
### 2.0.0
4+
5+
_2025-03-18_
6+
7+
- 添加 props 参数,并移除 label-key、options-key、disabled-key、object-key 参数,原先的 object-key 改名为 value-key。
8+
- props 默认值为 { value: 'value', label: 'label', disabled: 'disabled', options: 'options' }。
9+
310
### 1.4.6
411

512
_2025-01-07_

README.md

+40-34
Original file line numberDiff line numberDiff line change
@@ -53,40 +53,46 @@ Vue.use(ElSelectV2);
5353

5454
### Select Attributes
5555

56-
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
57-
|-------------------------|--------------------------------------------------|---------------------------|-------------------|----------|
58-
| value / v-model | 绑定值 | boolean / string / number |||
59-
| options | 列表数据 | array |||
60-
| value-key | value 键名 | string || value |
61-
| label-key | label 键名 | string || label |
62-
| options-key (1.4.6) | options 键名 | string || options |
63-
| disabled-key (1.4.1) | disabled 键名 | string || disabled |
64-
| object-key (1.4.0) | 绑定值为对象类型时的键名 | string || value |
65-
| min-item-size | 每个选项的最小高度 | number || 34 |
66-
| multiple | 是否多选 | boolean || false |
67-
| disabled | 是否禁用 | boolean || false |
68-
| size | 输入框尺寸 | string | medium/small/mini ||
69-
| clearable | 是否可以清空选项 | boolean || false |
70-
| collapse-tags | 多选时是否将选中值按文字的形式展示 | boolean || false |
71-
| multiple-limit | 多选时用户最多可以选择的项目数,为 0 则不限制 | number || 0 |
72-
| name | select input 的 name 属性 | string |||
73-
| autocomplete | select input 的 autocomplete 属性 | string || off |
74-
| placeholder | 占位符 | string || 请选择 |
75-
| filterable | 是否可搜索 | boolean || false |
76-
| allow-create | 是否允许用户创建新条目,需配合 `filterable` 使用 | boolean || false |
77-
| filter-method | 自定义搜索方法 | function |||
78-
| remote | 是否为远程搜索 | boolean || false |
79-
| remote-method | 远程搜索方法 | function |||
80-
| loading | 是否正在从远程获取数据 | boolean || false |
81-
| loading-text | 远程加载时显示的文字 | string || 加载中 |
82-
| no-match-text | 搜索条件无匹配时显示的文字,也可以使用 `slot="empty"` 设置 | string || 无匹配数据 |
83-
| no-data-text | 选项为空时显示的文字,也可以使用 `slot="empty"` 设置 | string || 无数据 |
84-
| popper-class | Select 下拉框的类名 | string |||
85-
| reserve-keyword | 多选且可搜索时,是否在选中一个选项后保留当前的搜索关键词 | boolean || true |
86-
| default-first-option | 在输入框按下回车,选择第一个匹配项。需配合 `filterable``remote` 使用 | boolean || false |
87-
| popper-append-to-body | 是否将弹出框插入至 body 元素。在弹出框的定位出现问题时,可将该属性设置为 false | boolean || true |
88-
| automatic-dropdown | 对于不可搜索的 Select,是否在输入框获得焦点后自动弹出选项菜单 | boolean || false |
89-
| fit-input-width (1.1.0) | 下拉框的宽度是否与输入框相同,设置为 false 后自动计算宽度,性能会有所降低 | boolean || true |
56+
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
57+
|-------------------------|--------------------------------------------------|---------------------------|-------------------|-------|
58+
| value / v-model | 绑定值 | boolean / string / number |||
59+
| options | 列表数据 | array |||
60+
| props | 配置选项,具体看下表 | object |||
61+
| value-key | 作为 value 唯一标识的键名,绑定值为对象类型时必填 | string || value |
62+
| min-item-size | 每个选项的最小高度 | number || 34 |
63+
| multiple | 是否多选 | boolean || false |
64+
| disabled | 是否禁用 | boolean || false |
65+
| size | 输入框尺寸 | string | medium/small/mini ||
66+
| clearable | 是否可以清空选项 | boolean || false |
67+
| collapse-tags | 多选时是否将选中值按文字的形式展示 | boolean || false |
68+
| multiple-limit | 多选时用户最多可以选择的项目数,为 0 则不限制 | number || 0 |
69+
| name | select input 的 name 属性 | string |||
70+
| autocomplete | select input 的 autocomplete 属性 | string || off |
71+
| placeholder | 占位符 | string || 请选择 |
72+
| filterable | 是否可搜索 | boolean || false |
73+
| allow-create | 是否允许用户创建新条目,需配合 `filterable` 使用 | boolean || false |
74+
| filter-method | 自定义搜索方法 | function |||
75+
| remote | 是否为远程搜索 | boolean || false |
76+
| remote-method | 远程搜索方法 | function |||
77+
| loading | 是否正在从远程获取数据 | boolean || false |
78+
| loading-text | 远程加载时显示的文字 | string || 加载中 |
79+
| no-match-text | 搜索条件无匹配时显示的文字,也可以使用 `slot="empty"` 设置 | string || 无匹配数据 |
80+
| no-data-text | 选项为空时显示的文字,也可以使用 `slot="empty"` 设置 | string || 无数据 |
81+
| popper-class | Select 下拉框的类名 | string |||
82+
| reserve-keyword | 多选且可搜索时,是否在选中一个选项后保留当前的搜索关键词 | boolean || true |
83+
| default-first-option | 在输入框按下回车,选择第一个匹配项。需配合 `filterable``remote` 使用 | boolean || false |
84+
| popper-append-to-body | 是否将弹出框插入至 body 元素。在弹出框的定位出现问题时,可将该属性设置为 false | boolean || true |
85+
| automatic-dropdown | 对于不可搜索的 Select,是否在输入框获得焦点后自动弹出选项菜单 | boolean || false |
86+
| fit-input-width (1.1.0) | 下拉框的宽度是否与输入框相同,设置为 false 后自动计算宽度,性能会有所降低 | boolean || true |
87+
88+
### Props
89+
90+
| 参数 | 说明 | 类型 | 默认值 |
91+
|----------|---------------------|--------|----------|
92+
| value | 指定选项的值为选项对象的某个属性值 | string | value |
93+
| label | 指定节点标签为节点对象的某个属性值 | string | label |
94+
| options | 指定选项的子选项为选项对象的某个属性值 | string | options |
95+
| disabled | 指定选项的禁用为选项对象的某个属性值 | string | disabled |
9096

9197
### Select Events
9298

docs/assets/index-BDcoqnfa.js

-137
This file was deleted.

docs/assets/index-BZ_jv-oV.js

+145
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/assets/index-D8de3ibR.css docs/assets/index-D-8JM77L.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/index.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
<link rel="icon" type="image/svg+xml" href="./vite.svg" />
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
77
<title>Select V2 虚拟列表选择器</title>
8-
<script type="module" crossorigin src="./assets/index-BDcoqnfa.js"></script>
9-
<link rel="stylesheet" crossorigin href="./assets/index-D8de3ibR.css">
8+
<script type="module" crossorigin src="./assets/index-BZ_jv-oV.js"></script>
9+
<link rel="stylesheet" crossorigin href="./assets/index-D-8JM77L.css">
1010
</head>
1111
<body>
1212
<div id="app"></div>

eslint.config.js

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
import { defineConfig } from 'eslint/config';
2+
import pluginVue from 'eslint-plugin-vue';
3+
import globals from 'globals';
4+
5+
export default defineConfig([
6+
...pluginVue.configs['flat/vue2-recommended'],
7+
{
8+
languageOptions: {
9+
sourceType: 'module',
10+
globals: {
11+
...globals.browser,
12+
},
13+
},
14+
rules: {
15+
// js
16+
'eol-last': 'error',
17+
'no-trailing-spaces': 'error',
18+
'comma-style': ['error', 'last'],
19+
'comma-dangle': ['error', 'always-multiline'],
20+
'no-multi-spaces': 'error',
21+
quotes: ['error', 'single', { avoidEscape: true, allowTemplateLiterals: true }],
22+
'object-curly-spacing': ['error', 'always'],
23+
'arrow-parens': ['error', 'as-needed'],
24+
'spaced-comment': ['error', 'always'],
25+
'semi': [2, 'always'],
26+
// vue
27+
'vue/no-v-html': 'off',
28+
'vue/singleline-html-element-content-newline': 'off',
29+
'vue/multi-word-component-names': 'off',
30+
'vue/max-attributes-per-line': ['error', { singleline: 3, multiline: 1 }],
31+
'vue/script-indent': ['error', 2, { baseIndent: 1, switchCase: 1 }],
32+
'vue/order-in-components': 'off',
33+
'vue/require-default-prop': 'off',
34+
'vue/html-closing-bracket-spacing': 'error',
35+
'vue/require-prop-types': 'off',
36+
'vue/prop-name-casing': 'off',
37+
'vue/no-template-shadow': 'off',
38+
'vue/no-side-effects-in-computed-properties': 'off',
39+
'vue/no-mutating-props': 'off',
40+
'vue/no-use-v-if-with-v-for': 'off',
41+
'vue/require-v-for-key': 'off',
42+
'vue/valid-v-for': 'off',
43+
'vue/no-unused-vars': 'off',
44+
'vue/no-v-model-argument': 'off',
45+
'vue/no-multiple-template-root': 'off',
46+
},
47+
},
48+
{
49+
ignores: [
50+
'node_modules',
51+
'dist',
52+
'output',
53+
'README.md',
54+
],
55+
},
56+
]);

0 commit comments

Comments
 (0)