Skip to content

Commit d938bd4

Browse files
committed
fix: fix Forms and Switches bugs
1 parent d5a0511 commit d938bd4

File tree

2 files changed

+42
-34
lines changed

2 files changed

+42
-34
lines changed

src/views/base/Forms.vue

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@
187187
:custom="key > 1"
188188
:name="`Option 1${key}`"
189189
:checked="Math.random() > 0.6"
190-
:class="key % 2 === 1 ? 'form-check-inline' : ''"
190+
:inline="key % 2 === 1"
191191
/>
192192
</CCol>
193193
</div>
@@ -207,7 +207,7 @@
207207
:custom="key > 1"
208208
:name="`Option 1${key}`"
209209
checked="Option 1"
210-
:class="key % 2 === 1 ? 'form-check-inline' : ''"
210+
:inline="key % 2 === 1"
211211
/>
212212
</CCol>
213213
</div>
@@ -474,18 +474,18 @@
474474
<CCardBody>
475475
<CFormInput
476476
placeholder="Username"
477-
prepend="<i class='fa fa-user'></i>"
477+
prependHtml="<i class='fa fa-user'></i>"
478478
/>
479479
<CFormInput
480480
type="email"
481481
placeholder="Email"
482482
autocomplete="email"
483-
append="<i class='fa fa-envelope-o'></i>"
483+
appendHtml="<i class='fa fa-envelope-o'></i>"
484484
/>
485485
<CFormInput
486-
prepend="<i class='fa fa-euro'></i>"
486+
prependHtml="<i class='fa fa-euro'></i>"
487487
placeholder="ex. $1.000.000"
488-
append=".00"
488+
appendHtml=".00"
489489
/>
490490
</CCardBody>
491491
<CCardFooter>
@@ -542,7 +542,7 @@
542542
<CFormInput placeholder="Username">
543543
<template #prepend>
544544
<CDropdown
545-
buttonContent="Action"
545+
buttonHtml="Action"
546546
variant="primary"
547547
>
548548
<CDropdownItem>Action</CDropdownItem>
@@ -559,7 +559,7 @@
559559
>
560560
<template #append>
561561
<CDropdown
562-
buttonContent="Action"
562+
buttonHtml="Action"
563563
variant="primary"
564564
right
565565
>
@@ -574,7 +574,7 @@
574574

575575
<template #prepend>
576576
<CDropdown
577-
buttonContent="Split"
577+
buttonHtml="Split"
578578
variant="primary"
579579
split
580580
>
@@ -587,7 +587,7 @@
587587

588588
<template #append>
589589
<CDropdown
590-
buttonContent="Action"
590+
buttonHtml="Action"
591591
variant="primary"
592592
right
593593
>
@@ -674,20 +674,20 @@
674674
<CCardBody>
675675
<CForm>
676676
<CFormInput
677-
prepend="Username"
678-
append="<i class='fa fa-user'></i>"
677+
prependHtml="Username"
678+
appendHtml="<i class='fa fa-user'></i>"
679679
/>
680680
<CFormInput
681-
prepend="Email"
681+
prependHtml="Email"
682682
type="email"
683683
autocomplete="email"
684-
append="<i class='fa fa-envelope'></i>"
684+
appendHtml="<i class='fa fa-envelope'></i>"
685685
/>
686686
<CFormInput
687-
prepend="Password"
687+
prependHtml="Password"
688688
type="password"
689689
autocomplete="current-password"
690-
append="<i class='fa fa-asterisk'></i>"
690+
appendHtml="<i class='fa fa-asterisk'></i>"
691691
/>
692692
<div class="form-group form-actions">
693693
<CButton type="submit" size="sm" variant="primary">Submit</CButton>
@@ -705,19 +705,19 @@
705705
<CForm>
706706
<CFormInput
707707
placeholder="Username"
708-
append="<i class='fa fa-user'></i>"
708+
appendHtml="<i class='fa fa-user'></i>"
709709
/>
710710
<CFormInput
711711
placeholder="Email"
712712
type="email"
713713
autocomplete="email"
714-
append="<i class='fa fa-envelope'></i>"
714+
appendHtml="<i class='fa fa-envelope'></i>"
715715
/>
716716
<CFormInput
717717
placeholder="Password"
718718
type="password"
719719
autocomplete="current-password"
720-
append="<i class='fa fa-asterisk'></i>"
720+
appendHtml="<i class='fa fa-asterisk'></i>"
721721
/>
722722
<div class="form-group form-actions">
723723
<CButton type="submit" class="btn btn-sm btn-secondary">Submit</CButton>
@@ -735,19 +735,19 @@
735735
<CForm>
736736
<CFormInput
737737
placeholder="Username"
738-
prepend="<i class='fa fa-user'></i>"
738+
prependHtml="<i class='fa fa-user'></i>"
739739
/>
740740
<CFormInput
741741
placeholder="Email"
742742
type="email"
743743
autocomplete="email"
744-
prepend="<i class='fa fa-envelope'></i>"
744+
prependHtml="<i class='fa fa-envelope'></i>"
745745
/>
746746
<CFormInput
747747
placeholder="Password"
748748
type="password"
749749
autocomplete="current-password"
750-
prepend="<i class='fa fa-asterisk'></i>"
750+
prependHtml="<i class='fa fa-asterisk'></i>"
751751
/>
752752
<div class="form-group form-actions">
753753
<CButton type="submit" size="sm" variant="success">Submit</CButton>
@@ -782,20 +782,20 @@
782782
<CCardBody>
783783
<CFormInput
784784
label="Prepended text"
785-
prepend="@"
785+
prependHtml="@"
786786
description="Here's some help text"
787787
type="email"
788788
autocomplete="email"
789789
/>
790790
<CFormInput
791791
label="Appended text"
792-
append=".00"
792+
appendHtml=".00"
793793
description="Here's some help text"
794794
/>
795795
<CFormInput
796-
label="Appended text"
797-
prepend="$"
798-
append=".00"
796+
label="Appended and prepended text"
797+
prependHtml="$"
798+
appendHtml=".00"
799799
description="Here's some help text"
800800
/>
801801
<CFormInput

src/views/base/Switches.vue

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<template>
22
<div class="animated fadeIn">
3-
43
<CRow>
54
<CCol xs="12" md="6">
65
<CCard v-if="true">
@@ -12,6 +11,14 @@
1211
</h5>
1312
</CCardHeader>
1413
<CCardBody>
14+
<!-- <CSwitch
15+
:checked.sync="test11"
16+
trueValue="yes"
17+
falseValue="no"
18+
id="alt"
19+
name="lg"
20+
required
21+
/> -->
1522
<!-- <CSwitch class="mx-1" variant="primary" shape="3d" outline="alt" v-bind="labelIcon" type="radio" name="radio" checked.sync="radio" trueValue="primary"/> -->
1623
<CSwitch class="mx-1"
1724
:key="key"
@@ -368,7 +375,7 @@
368375
Switch <small><code>label</code></small>
369376
</CCardHeader>
370377
<CCardBody>
371-
<CSwitch class="mx-1" variant="primary" checked dataOn="" dataOff=""/>
378+
<CSwitch class="mx-1" variant="primary" checked v-bind="labelIcon"/>
372379
<CSwitch class="mx-1" variant="secondary" checked v-bind="labelIcon" />
373380
<CSwitch class="mx-1" variant="success" checked v-bind="labelIcon" />
374381
<CSwitch class="mx-1" variant="warning" checked v-bind="labelIcon" />
@@ -526,13 +533,14 @@ export default {
526533
checker: 'yes',
527534
radio: 'primary',
528535
labelIcon: {
529-
dataOn: '\u2713',
530-
dataOff: '\u2715'
536+
labelOn: '\u2713',
537+
labelOff: '\u2715'
531538
},
532539
labelTxt: {
533-
dataOn: 'yes',
534-
dataOff: 'no'
535-
}
540+
labelOn: 'yes',
541+
labelOff: 'no'
542+
},
543+
536544
}
537545
}
538546
}

0 commit comments

Comments
 (0)