qtsk-vue3 0.0.43 → 0.0.45

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'
@@ -25,6 +26,8 @@ import Upload from './components/Upload/index.vue'
25
26
  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'
29
+ import PopConfirm from './components/PopConfirm/index.vue'
30
+ import Drawer from './components/Drawer/index.vue'
28
31
  const components =
29
32
  [
30
33
  CommonButton,
@@ -53,6 +56,9 @@ const components =
53
56
  Upload,
54
57
  Tooltip,
55
58
  Skeleton,
56
- Alert
59
+ Alert,
60
+ PopConfirm,
61
+ SelectGroup,
62
+ Drawer
57
63
  ]
58
64
  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,52 @@
1
+ <template>
2
+ <el-popconfirm
3
+ :title="title"
4
+ v-bind="$attrs"
5
+ @confirm="confirmEvent"
6
+ @cancel="cancelEvent"
7
+ >
8
+ <template #reference>
9
+ <slot></slot>
10
+ </template>
11
+ <template #actions>
12
+ <slot name="actions"></slot>
13
+ </template>
14
+ </el-popconfirm>
15
+ </template>
16
+
17
+ <script setup>
18
+ import { ElPopconfirm } from 'element-plus'
19
+
20
+ defineOptions({
21
+ name: 'PopConfirm'
22
+ })
23
+ const props = defineProps({
24
+ title: {
25
+ type: String,
26
+ default: '标题'
27
+ },
28
+ confirmButtonText: {
29
+ type: String,
30
+ default: '确认'
31
+ },
32
+ cancelButtonText: {
33
+ type: String,
34
+ default: '取消'
35
+ }
36
+ })
37
+ const emits = defineEmits(['confirm', 'cancel'])
38
+ const confirmEvent = () => {
39
+ console.log('confirm!')
40
+ emits('confirm')
41
+ }
42
+ const cancelEvent = () => {
43
+ console.log('cancel!')
44
+ emits('cancel')
45
+ }
46
+ </script>
47
+
48
+ <style lang="less" scoped>
49
+ :deep(.el-textarea__inner:focus), :deep(.el-input__wrapper.is-focus){
50
+ box-shadow: 0 0 0 1px var(--main-color) inset;
51
+ }
52
+ </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>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qtsk-vue3",
3
- "version": "0.0.43",
3
+ "version": "0.0.45",
4
4
  "description": "vue3版组件库",
5
5
  "main": "./package/index.js",
6
6
  "scripts": {