qtsk-vue3 0.0.44 → 0.0.46

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.
@@ -16,6 +16,7 @@ import Empty from './components/Empty/index.vue'
16
16
  import Tabs from './components/Tabs/index.vue'
17
17
  import TabPane from './components/TabPane/index.vue'
18
18
  import SelectRemote from './components/SelectRemote/index.vue'
19
+ import SelectGroup from './components/SelectGroup/index.vue'
19
20
  import Timeline from './components/Timeline/index.vue'
20
21
  import Area from './components/Area/index.vue'
21
22
  import Radio from './components/Radio/index.vue'
@@ -26,6 +27,8 @@ import Tooltip from './components/Tooltip/index.vue'
26
27
  import Skeleton from './components/Skeleton/index.vue'
27
28
  import Alert from './components/Alert/index.vue'
28
29
  import PopConfirm from './components/PopConfirm/index.vue'
30
+ import Drawer from './components/Drawer/index.vue'
31
+ import TreeSelect from './components/TreeSelect/index.vue'
29
32
  const components =
30
33
  [
31
34
  CommonButton,
@@ -55,6 +58,9 @@ const components =
55
58
  Tooltip,
56
59
  Skeleton,
57
60
  Alert,
58
- PopConfirm
61
+ PopConfirm,
62
+ SelectGroup,
63
+ Drawer,
64
+ TreeSelect
59
65
  ]
60
66
  export default components
@@ -0,0 +1,34 @@
1
+ <template>
2
+ <div>
3
+ <el-drawer v-model="drawerVisible" :direction="direction" v-bind="$attrs">
4
+ <template #header>
5
+ <slot name="header"/>
6
+ </template>
7
+ <template #default>
8
+ <slot />
9
+ </template>
10
+ <template #footer>
11
+ <slot name="footer"/>
12
+ </template>
13
+ </el-drawer>
14
+ </div>
15
+ </template>
16
+
17
+ <script setup>
18
+ import { ElDrawer } from 'element-plus'
19
+
20
+ defineOptions({
21
+ name: 'Drawer',
22
+ })
23
+ defineProps({
24
+ direction: {
25
+ type: String,
26
+ default: 'rtl', //'rtl' | 'ltr' | 'ttb' | 'btt' 方向
27
+ },
28
+ })
29
+
30
+ const drawerVisible = defineModel('modelValue')
31
+ </script>
32
+
33
+ <style lang="less" scoped>
34
+ </style>
@@ -0,0 +1,74 @@
1
+ <template>
2
+ <el-select
3
+ v-model="selectValue"
4
+ :placeholder="placeholder"
5
+ v-bind="$attrs"
6
+ :teleported="teleported"
7
+ :append-to="append"
8
+ :no-data-text="'暂无数据项'"
9
+ :clearable="clearable"
10
+ :noMatchText="'暂无匹配数据'"
11
+ >
12
+ <el-option-group
13
+ v-for="group in options"
14
+ :key="group.label"
15
+ :label="group.label"
16
+ >
17
+ <el-option v-for="item in group.options" :key="item[valueName]" :label="item[keyName]" :value="item[valueName]">
18
+ <div v-if="item.icon" style="display: flex;align-items: center;justify-content: space-between;">
19
+ <Icons :type="item.icon"/>
20
+ <span>{{ item.icon }}</span>
21
+ </div>
22
+ </el-option>
23
+ </el-option-group>
24
+ </el-select>
25
+ </template>
26
+
27
+ <script setup>
28
+ import { ElSelect, ElOption, ElOptionGroup } from 'element-plus'
29
+ import '../../style/root.css'
30
+
31
+ defineOptions({
32
+ name: 'SelectGroup'
33
+ })
34
+ defineProps({
35
+ placeholder: {
36
+ type: String,
37
+ default: '请选择'
38
+ },
39
+ options: {
40
+ type: Array,
41
+ default: () => ([])
42
+ },
43
+ keyName: {
44
+ type: String,
45
+ default: 'label'
46
+ },
47
+ valueName: {
48
+ type: String,
49
+ default: 'value'
50
+ },
51
+ clearable: {
52
+ type: Boolean,
53
+ default: true
54
+ },
55
+ append: {
56
+ type: String,
57
+ default: 'body'
58
+ },
59
+ teleported: {
60
+ type: Boolean,
61
+ default: false
62
+ }
63
+ })
64
+ const selectValue = defineModel('modelValue', { default: '', type: [Number, String, Array] })
65
+ </script>
66
+
67
+ <style lang="less" scoped>
68
+ :deep(.el-select__wrapper.is-focused){
69
+ box-shadow: 0 0 0 1px var(--main-color) inset;
70
+ }
71
+ :deep(.el-select-dropdown__item.is-selected){
72
+ color: var(--main-color);
73
+ }
74
+ </style>
@@ -0,0 +1,41 @@
1
+ <template>
2
+ <div>
3
+ <el-tree-select
4
+ v-model="modelValue"
5
+ v-bind="$attrs"
6
+ :data="options"
7
+ :multiple="multiple"
8
+ :render-after-expand="false"
9
+ :show-checkbox="showCheckbox"
10
+ />
11
+ </div>
12
+ </template>
13
+
14
+ <script setup>
15
+ import { ElTreeSelect } from 'element-plus'
16
+
17
+ defineOptions({
18
+ name: 'TreeSelect',
19
+ })
20
+ defineProps({
21
+ options: {
22
+ type: Array,
23
+ default: () => ([])
24
+ },
25
+ // 是否多选
26
+ multiple: {
27
+ type: Boolean,
28
+ default: false
29
+ },
30
+ // 是否显示复选框
31
+ showCheckbox: {
32
+ type: Boolean,
33
+ default: false
34
+ },
35
+ })
36
+
37
+ const modelValue = defineModel('modelValue')
38
+ </script>
39
+
40
+ <style lang="less" scoped>
41
+ </style>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qtsk-vue3",
3
- "version": "0.0.44",
3
+ "version": "0.0.46",
4
4
  "description": "vue3版组件库",
5
5
  "main": "./package/index.js",
6
6
  "scripts": {