qtsk-vue3 0.0.29 → 0.0.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,10 +1,12 @@
1
1
  <template>
2
2
  <el-select
3
+ ref="selectRef"
3
4
  v-model="selectValue"
4
5
  :placeholder="placeholder"
5
6
  v-bind="$attrs"
6
7
  :teleported="false"
7
8
  :loading="loading"
9
+ v-limitLength="maxLength"
8
10
  clearable
9
11
  filterable
10
12
  remote
@@ -28,7 +30,6 @@ import { ElSelect, ElOption } from 'element-plus'
28
30
  import '../../style/root.css'
29
31
 
30
32
  const loading = ref(false)
31
-
32
33
  defineOptions({
33
34
  name: 'SelectRemote'
34
35
  })
@@ -51,14 +52,25 @@ const props = defineProps({
51
52
  list: {
52
53
  type: Array,
53
54
  default: () => ([])
54
- }
55
+ },
56
+ maxLength: Number
55
57
  })
56
58
  const selectValue = defineModel('modelValue', { default: '', type: [Number, String, Array] })
57
59
  const options = ref([])
60
+
61
+ const vLimitLength = {
62
+ mounted: function (el, binding) {
63
+ if (!props.maxLength) return false
64
+ const input = el.getElementsByTagName('input')[0]
65
+ if (input) {
66
+ input.setAttribute('maxlength', binding.value)
67
+ }
68
+ }
69
+ }
58
70
  const remoteMethod = (query) => {
59
71
  if (query) {
60
- props.remoteMethod(query)
61
72
  selectValue.value = query
73
+ props.remoteMethod(query)
62
74
  } else {
63
75
  options.value = []
64
76
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qtsk-vue3",
3
- "version": "0.0.29",
3
+ "version": "0.0.30",
4
4
  "description": "vue3版组件库",
5
5
  "main": "./package/index.js",
6
6
  "scripts": {