Skip to content

Commit

Permalink
fix: 修复部分组件警告错误
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyh2001 committed Aug 4, 2023
1 parent 819a300 commit 818fc2c
Show file tree
Hide file tree
Showing 14 changed files with 28 additions and 42 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,17 @@
- 修复 `f-input` 组件在双向绑定空值时的警告问题
- 修复 `f-dialog` 组件在双向绑定空值时的警告问题
- 修复 `f-drawer` 组件在双向绑定空值时的警告问题
- 修复 `f-date-picker` 组件在双向绑定空值时的警告问题
- 修复 `f-image-preview` 组件在双向绑定空值时的警告问题
- 修复 `f-input-number` 组件在双向绑定空值时的警告问题
- 修复 `f-pagination` 组件在双向绑定空值时的警告问题
- 修复 `f-radio-group` 组件在双向绑定空值时的警告问题
- 修复 `f-swap` 组件在双向绑定空值时的警告问题
- 修复 `f-select` 组件在双向绑定空值时的警告问题
- 修复 `f-switch` 组件在双向绑定空值时的警告问题
- 修复 `f-time-pick` 组件在双向绑定空值时的警告问题
- 修复 `f-up-load` 组件在双向绑定空值时的警告问题
- 修复 `f-rate` 组件在双向绑定空值时的警告问题

## 0.52.0 (2023-07-14)

Expand Down
1 change: 0 additions & 1 deletion packages/fighting-design/date-picker/src/date-picker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
const prop = defineProps(Props)
const dateModelValue = defineModel<string>('date', {
required: true,
default: '',
type: String
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
const prop = defineProps(Props)
const visible = defineModel<boolean>('visible', {
required: true,
default: false,
type: Boolean
})
Expand Down
2 changes: 1 addition & 1 deletion packages/fighting-design/input-number/src/input-number.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
defineOptions({ name: 'FInputNumber' })
const prop = defineProps(Props)
const modelValue = defineModel<number>({ required: true, default: 0, type: Number })
const modelValue = defineModel<number>({ default: 0, type: Number })
const { run } = useRun()
Expand Down
1 change: 0 additions & 1 deletion packages/fighting-design/pagination/src/pagination.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
const prop = defineProps(Props)
/** 当前选中页码 */
const currentModelValue = defineModel<number>('current', {
required: true,
default: 1,
type: Number
})
Expand Down
3 changes: 1 addition & 2 deletions packages/fighting-design/radio-group/src/radio-group.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
const prop = defineProps(Props)
const modelValue = defineModel<RadioModelValue>({
required: true,
default: null,
default: '',
type: [String, Number, Boolean]
})
Expand Down
2 changes: 1 addition & 1 deletion packages/fighting-design/rate/src/rate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
defineOptions({ name: 'FRate' })
const prop = defineProps(Props)
const modelValue = defineModel<number>({ required: true, default: 0, type: Number })
const modelValue = defineModel<number>({ default: 0, type: Number })
const { run } = useRun()
Expand Down
3 changes: 1 addition & 2 deletions packages/fighting-design/select/src/select.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
const prop = defineProps(Props)
const slot: Slots = useSlots()
const modelValue = defineModel<SelectModelValue>({
required: true,
default: null,
default: '',
type: [String, Number]
})
Expand Down
2 changes: 1 addition & 1 deletion packages/fighting-design/slider/src/slider.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
defineOptions({ name: 'FSlider' })
const prop = defineProps(Props)
const modelValue = defineModel<number>({ required: true, default: 0, type: Number })
const modelValue = defineModel<number>({ default: 0, type: Number })
const { styles, classes } = useList(prop, 'slider')
Expand Down
6 changes: 1 addition & 5 deletions packages/fighting-design/swap/src/swap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@
defineOptions({ name: 'FSwap' })
const prop = defineProps(Props)
const modelValue = defineModel<boolean>({
required: true,
default: false,
type: Boolean
})
const modelValue = defineModel<boolean>({ default: false, type: Boolean })
const { run } = useRun()
const { classes } = useList(prop, 'swap')
Expand Down
6 changes: 1 addition & 5 deletions packages/fighting-design/switch/src/switch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@
defineOptions({ name: 'FSwitch' })
const prop = defineProps(Props)
const modelValue = defineModel<boolean>({
required: true,
default: false,
type: Boolean
})
const modelValue = defineModel<boolean>({ default: false, type: Boolean })
const { run } = useRun()
const { getProp } = useGlobal(prop)
Expand Down
6 changes: 1 addition & 5 deletions packages/fighting-design/time-picker/src/time-picker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@
defineOptions({ name: 'FTimePicker' })
defineProps(Props)
const dateModelValue = defineModel<string>('time', {
required: true,
default: '',
type: String
})
const dateModelValue = defineModel<string>('time', { default: '', type: String })
/** 获取当前的时间 */
const nowDate: Date = new Date()
Expand Down
6 changes: 1 addition & 5 deletions packages/fighting-design/up-load/src/up-load.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@
defineOptions({ name: 'FUpLoad' })
const prop = defineProps(Props)
const filesModelValue = defineModel<File[]>('files', {
required: true,
default: [],
type: Array
})
const filesModelValue = defineModel<File[]>('files', { default: [], type: Array })
const { run } = useRun()
Expand Down
20 changes: 8 additions & 12 deletions start/src/App.vue
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
<script setup lang="ts">
<script lang="ts" setup>
import { ref } from 'vue'
const visible1 = ref(null)
const value = ref(undefined)
</script>

<template>
<f-button type="primary" @click="visible1 = true">打开</f-button>

<f-drawer v-model:visible="visible1" title="标题文字">
这是一个 Dialog

<template #footer>
<f-button type="default">默认按钮</f-button>
<f-button type="primary">主要按钮</f-button>
</template>
</f-drawer>
<f-select v-model="value" placeholder="请选择……">
<f-option :value="1">香蕉</f-option>
<f-option :value="2">苹果</f-option>
<f-option :value="3">哈密瓜</f-option>
<f-option :value="4">樱桃</f-option>
</f-select>
</template>

0 comments on commit 818fc2c

Please sign in to comment.