This repository was archived by the owner on Apr 25, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +20
-2
lines changed Expand file tree Collapse file tree 4 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -203,6 +203,16 @@ export default {
203203</script>
204204```
205205
206+ Set ` :fixed ` to ` true ` to make label permanently active:
207+
208+ ``` vue
209+ <template>
210+ <float-label fixed>
211+ <input type="text" placeholder="Fixed">
212+ </float-label>
213+ </template>
214+ ```
215+
206216Set ` :dispatch ` to ` false ` to disable triggering ` input ` event
207217once the component is mounted:
208218
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ export default {
1515 type: Boolean ,
1616 default: true
1717 },
18- always : {
18+ fixed : {
1919 type: Boolean ,
2020 default: false
2121 },
@@ -84,7 +84,7 @@ export default {
8484 },
8585 classObject () {
8686 return {
87- ' vfl-label-on-input' : this .on && (this .isActive || this .always ),
87+ ' vfl-label-on-input' : this .on && (this .isActive || this .fixed ),
8888 ' vfl-label-on-focus' : this .isFocused
8989 }
9090 },
Original file line number Diff line number Diff line change 3939 </select >
4040 </float-label >
4141
42+ <float-label fixed >
43+ <input type =" text" placeholder =" Fixed" >
44+ </float-label >
45+
4246 <div class =" example" >
4347 <float-label >
4448 <input type =" text" placeholder =" Website" >
Original file line number Diff line number Diff line change @@ -85,5 +85,9 @@ test(':label', () => {
8585 expect ( ctorInput ( { label : 'Foobar' } ) . floatLabel ) . toEqual ( 'Foobar' )
8686} )
8787
88+ test ( ':fixed' , ( ) => {
89+ expect ( ctorInput ( { fixed : true } ) . classObject ) . toMatchObject ( { 'vfl-label-on-input' : true } )
90+ } )
91+
8892xtest ( ':on' )
8993xtest ( ':dispatch' )
You can’t perform that action at this time.
0 commit comments