ksc-fe / kpc

A UI Components Library for Intact, Vue, React and Angular.
https://design.ksyun.com/
MIT License
364 stars 53 forks source link

Switch开关放到FormItem的label里时会失效,点击无法操作开闭 #997

Closed AmazingBubble closed 6 months ago

AmazingBubble commented 6 months ago

CodeSandbox <FormItem :value="data.callback"

Description

Javey commented 6 months ago

贴下代码看看

AmazingBubble commented 6 months ago
<FormItem
    :value="data.callback"
>
    <template slot="label">
        <span class="margin-r-8">{{ _$('设置回调') }}</span>
        <KSwitch v-model="openCallback" size='small' />
    </template>
    <Input v-if="openCallback" class="margin-t-8" width="400" v-model="data.callback" :placeholder="_$('请输入回调地址,以http[s]://开头')"></Input>
</FormItem>
warrior-bing commented 6 months ago

@AmazingBubble label标签默认行为影响,如下阻止默认行为即可 <FormItem :value="data.callback"

...