qtsk-vue3 0.0.15 → 0.0.17

Sign up to get free protection for your applications and to get access to all the features.
@@ -17,6 +17,10 @@ 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
19
  import Timeline from './components/Timeline/index.vue'
20
+ import Area from './components/Area/index.vue'
21
+ import Radio from './components/Radio/index.vue'
22
+ import Number from './components/Number/index.vue'
23
+ import Checkbox from './components/CheckBox/index.vue'
20
24
  const components =
21
25
  [
22
26
  CommonButton,
@@ -29,7 +33,7 @@ const components =
29
33
  Switch,
30
34
  Pagination,
31
35
  DatePicker,
32
- Tree,
36
+ Tree,
33
37
  Dialog,
34
38
  Form,
35
39
  FormItem,
@@ -37,6 +41,10 @@ const components =
37
41
  Tabs,
38
42
  TabPane,
39
43
  SelectRemote,
40
- Timeline
44
+ Timeline,
45
+ Area,
46
+ Radio,
47
+ Number,
48
+ Checkbox
41
49
  ]
42
50
  export default components
@@ -0,0 +1,42 @@
1
+ <template>
2
+ <div class="normalClass">
3
+ <el-cascader
4
+ placeholder="请选择省市区"
5
+ size="default"
6
+ :options="regionData"
7
+ v-model="area"
8
+ >
9
+ </el-cascader>
10
+ </div>
11
+ </template>
12
+
13
+ <script setup>
14
+ import { computed } from 'vue'
15
+ import { ElCascader } from 'element-plus'
16
+ import { regionData } from 'element-china-area-data'
17
+ defineOptions({
18
+ name: 'Area',
19
+ })
20
+ const props = defineProps({
21
+ modelValue: {
22
+ type: Array,
23
+ default: () => ([])
24
+ }
25
+ })
26
+ const emits = defineEmits(['update:modelValue'])
27
+ const area = computed({
28
+ get(){
29
+ return props.modelValue
30
+ },
31
+ set(val){
32
+ console.log('val', val)
33
+ emits('update:modelValue', Object.values(val))
34
+ }
35
+ })
36
+ </script>
37
+
38
+ <style lang="less" scoped>
39
+ .normalClass{
40
+ margin: 0px;
41
+ }
42
+ </style>
@@ -0,0 +1,33 @@
1
+ <template>
2
+ <el-checkbox-group v-model="checkBoxValue">
3
+ <el-checkbox v-for="(item, index) in options" :value="item.value" :key="index">{{ item.label }}</el-checkbox>
4
+ </el-checkbox-group>
5
+ </template>
6
+
7
+ <script setup>
8
+ import { computed } from 'vue'
9
+ import { ElCheckboxGroup, ElCheckbox } from 'element-plus'
10
+ import '../../style/root.css'
11
+
12
+ defineOptions({
13
+ name: 'CheckBox'
14
+ })
15
+ const props = defineProps({
16
+ options: {
17
+ type: Array,
18
+ default: () => ([])
19
+ }
20
+ })
21
+ const emits = defineEmits(['update:modelValue'])
22
+ const checkBoxValue = computed({
23
+ get () {
24
+ return props.modelValue
25
+ },
26
+ set (value) {
27
+ emits('update:modelValue', value)
28
+ }
29
+ })
30
+ </script>
31
+
32
+ <style lang="less" scoped>
33
+ </style>
@@ -1,6 +1,15 @@
1
1
  <template>
2
2
  <el-config-provider :locale="zhCn">
3
- <el-date-picker style="width: 100%;" v-model="modelValue" :type="type" :placeholder="placeholder" :format="format" :value-format="format"/>
3
+ <el-date-picker
4
+ style="width: 100%;"
5
+ v-model="modelValue"
6
+ :type="type"
7
+ :placeholder="placeholder"
8
+ :format="format"
9
+ :value-format="format"
10
+ :start-placeholder="startPlaceholder"
11
+ :end-placeholder="endPlaceholder"
12
+ />
4
13
  </el-config-provider>
5
14
  </template>
6
15
 
@@ -24,6 +33,18 @@ const props = defineProps({
24
33
  type: {
25
34
  type: String,
26
35
  default: 'date'
36
+ },
37
+ startPlaceholder: {
38
+ type: String,
39
+ default: '开始日期'
40
+ },
41
+ startPlaceholder: {
42
+ type: String,
43
+ default: '开始日期'
44
+ },
45
+ endPlaceholder: {
46
+ type: String,
47
+ default: '结束日期'
27
48
  }
28
49
  })
29
50
 
@@ -1,12 +1,16 @@
1
1
  <template>
2
- <ElInput :type="type" :placeholder="placeholder" v-model="inputValue" v-bind="$attrs" clearable :disabled="disabled">
2
+ <ElInput :type="type" :placeholder="placeholder" v-model="inputValue" v-bind="$attrs" :disabled="disabled">
3
3
  <template #prepend v-if="$slots.prepend">
4
4
  <!-- 前缀 -->
5
5
  <slot name="prepend" />
6
6
  </template>
7
7
  <template #append v-if="$slots.append">
8
8
  <!-- 后缀 -->
9
- <slot name="append" />
9
+ <slot name="append" />
10
+ </template>
11
+ <template #suffix v-if="$slots.suffix">
12
+ <!-- 后缀图标 -->
13
+ <slot name="suffix" />
10
14
  </template>
11
15
  </ElInput>
12
16
  </template>
@@ -15,6 +19,7 @@
15
19
  import { computed } from 'vue'
16
20
  import {ElInput} from 'element-plus'
17
21
  import '../../style/root.css'
22
+ import { Search } from '@element-plus/icons-vue'
18
23
 
19
24
  defineOptions({
20
25
  name: 'Input'
@@ -35,6 +40,7 @@ const props = defineProps({
35
40
  disabled: Boolean
36
41
  })
37
42
  const emits = defineEmits(['update:modelValue'])
43
+ const formData = defineModel('formData')
38
44
  const inputValue = computed({
39
45
  get () {
40
46
  return props.modelValue
@@ -43,6 +49,7 @@ const inputValue = computed({
43
49
  if(value && typeof value === 'string'){
44
50
  value = value.trim()
45
51
  }
52
+ if (formData.value?.loc) formData.value.loc = ''
46
53
  emits('update:modelValue', value)
47
54
  }
48
55
  })
@@ -0,0 +1,20 @@
1
+ <template>
2
+ <div class="normalClass">
3
+ <el-input-number v-model="num" :min="1" />
4
+ </div>
5
+ </template>
6
+
7
+ <script setup>
8
+ import { ElInputNumber } from 'element-plus'
9
+ defineOptions({
10
+ name: 'Number',
11
+ })
12
+
13
+ const num = defineModel('modelValue', { type: Number, default: 1 })
14
+ </script>
15
+
16
+ <style lang="less" scoped>
17
+ .normalClass{
18
+ margin-right: 10px;
19
+ }
20
+ </style>
@@ -0,0 +1,33 @@
1
+ <template>
2
+ <el-radio-group v-model="radioValue">
3
+ <el-radio v-for="(item, index) in options" :value="item.value" :key="index">{{item.label}}</el-radio>
4
+ </el-radio-group>
5
+ </template>
6
+
7
+ <script setup>
8
+ import { computed } from 'vue'
9
+ import {ElRadioGroup, ElRadio} from 'element-plus'
10
+ import '../../style/root.css'
11
+
12
+ defineOptions({
13
+ name: 'Radio'
14
+ })
15
+ const props = defineProps({
16
+ options: {
17
+ type: Array,
18
+ default: () => ([])
19
+ }
20
+ })
21
+ const emits = defineEmits(['update:modelValue'])
22
+ const radioValue = computed({
23
+ get () {
24
+ return props.modelValue
25
+ },
26
+ set (value) {
27
+ emits('update:modelValue', value)
28
+ }
29
+ })
30
+ </script>
31
+
32
+ <style lang="less" scoped>
33
+ </style>
@@ -4,6 +4,7 @@
4
4
  :placeholder="placeholder"
5
5
  v-bind="$attrs"
6
6
  :teleported="false"
7
+ :no-data-text="'暂无数据项'"
7
8
  clearable
8
9
  >
9
10
  <el-option v-for="item in options" :key="item[valueName]" :label="item[keyName]" :value="item[valueName]">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qtsk-vue3",
3
- "version": "0.0.15",
3
+ "version": "0.0.17",
4
4
  "description": "vue3版组件库",
5
5
  "main": "./package/index.js",
6
6
  "scripts": {
@@ -20,6 +20,7 @@
20
20
  "dependencies": {
21
21
  "@element-plus/icons-vue": "^2.3.1",
22
22
  "@vue/shared": "^3.5.6",
23
+ "element-china-area-data": "^6.1.0",
23
24
  "element-plus": "^2.8.3"
24
25
  }
25
26
  }