fix: 🐛 修复在template中使用readonly无法通过vue-ts校验的问题

This commit is contained in:
Moonofweisheng 2025-03-04 13:44:39 +08:00
parent ef7c98bffb
commit ee5b25fbc3
7 changed files with 8 additions and 8 deletions

View File

@ -46,7 +46,7 @@ inquirer
default: 'Y'
}
])
.then((answers) => {
.then((answers: any) => {
if (!answers['release'] || answers['release'].toLowerCase() != 'y') {
console.log('🚨 操作取消')
return
@ -92,7 +92,7 @@ inquirer
const tip = 'Run `git push --follow-tags origin ' + branch + '` ' + 'to publish'
console.log(tip.replace(/\n/g, ''))
})
.catch((error) => {
.catch((error: any) => {
if (error.isTtyError) {
// Prompt couldn't be rendered in the current environment
} else {

View File

@ -163,7 +163,7 @@ const promotionlist = ref<any[]>([
])
const threshold = ref<string>('')
const price = ref<string>('')
const date = ref<Date>(new Date())
const date = ref<number>(new Date().getTime())
const address = ref<any[]>([])
const count = ref<number>(1)

View File

@ -4,7 +4,7 @@
<slot v-if="$slots.default"></slot>
<view
v-else
:class="`wd-calendar__cell ${disabled ? 'is-disabled' : ''} ${readonly ? 'is-readonly' : ''} ${alignRight ? 'is-align-right' : ''} ${
:class="`wd-calendar__cell ${disabled ? 'is-disabled' : ''} ${props.readonly ? 'is-readonly' : ''} ${alignRight ? 'is-align-right' : ''} ${
error ? 'is-error' : ''
} ${size ? 'is-' + size : ''} ${center ? 'is-center' : ''}`"
>

View File

@ -4,7 +4,7 @@
<slot v-if="useDefaultSlot"></slot>
<view
v-else
:class="`wd-col-picker__cell ${disabled && 'is-disabled'} ${readonly && 'is-readonly'} ${alignRight && 'is-align-right'} ${
:class="`wd-col-picker__cell ${disabled && 'is-disabled'} ${props.readonly && 'is-readonly'} ${alignRight && 'is-align-right'} ${
error && 'is-error'
} ${size && 'is-' + size}`"
>

View File

@ -50,7 +50,7 @@
@confirm="handleConfirm"
@keyboardheightchange="handleKeyboardheightchange"
/>
<view v-if="readonly" class="wd-input__readonly-mask" />
<view v-if="props.readonly" class="wd-input__readonly-mask" />
<view v-if="showClear || showPassword || suffixIcon || showWordCount || $slots.suffix" class="wd-input__suffix">
<wd-icon v-if="showClear" custom-class="wd-input__clear" name="error-fill" @click="handleClear" />
<wd-icon v-if="showPassword" custom-class="wd-input__icon" :name="isPwdVisible ? 'view' : 'eye-close'" @click="togglePwdVisible" />

View File

@ -4,7 +4,7 @@
<slot v-if="useDefaultSlot"></slot>
<view
v-else
:class="`wd-select-picker__cell ${disabled && 'is-disabled'} ${readonly && 'is-readonly'} ${alignRight && 'is-align-right'} ${
:class="`wd-select-picker__cell ${disabled && 'is-disabled'} ${props.readonly && 'is-readonly'} ${alignRight && 'is-align-right'} ${
error && 'is-error'
} ${size && 'is-' + size}`"
>

View File

@ -47,7 +47,7 @@
/>
<view v-if="errorMessage" class="wd-textarea__error-message">{{ errorMessage }}</view>
<view v-if="readonly" class="wd-textarea__readonly-mask" />
<view v-if="props.readonly" class="wd-textarea__readonly-mask" />
<view class="wd-textarea__suffix">
<wd-icon v-if="showClear" custom-class="wd-textarea__clear" name="error-fill" @click="handleClear" />
<view v-if="showWordCount" class="wd-textarea__count">