-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix partial-numeric string prop parsing
Internally Vue was using `parseFloat` for this, and `parseFloat('1abc') === 1` rather than `NaN` like it is for non-numeric strings The fix was lifted from vuejs/core#4393, so I'll double check whether that's been merged by the time the rest of this is ready
- Loading branch information
1 parent
867900d
commit e1a338e
Showing
7 changed files
with
145 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
import { defineNatively } from '@blueshift/ng-interop'; | ||
|
||
import PropTester from './prop-tester.vue'; | ||
import UserItem from './user-item.vue'; | ||
import UserList from './user-list.vue'; | ||
|
||
|
||
defineNatively([ | ||
PropTester, | ||
UserItem, | ||
UserList, | ||
]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<script> | ||
export default { | ||
name: 'prop-tester', | ||
props: { | ||
title: { | ||
type: String, | ||
}, | ||
likes: { | ||
type: Number, | ||
}, | ||
isPublished: { | ||
type: Boolean, | ||
}, | ||
commentIds: { | ||
type: Array, | ||
}, | ||
author: { | ||
type: Object, | ||
}, | ||
callback: { | ||
type: Function, | ||
}, | ||
promise: { | ||
type: Promise, | ||
}, // or any other constructor | ||
}, | ||
computed: { | ||
propsJSON() { | ||
const props = { | ||
title: this.title, | ||
likes: this.likes, | ||
isPublished: this.isPublished, | ||
commentIds: this.commentIds, | ||
author: this.author, | ||
callback: this.callback, | ||
promise: this.promise, | ||
}; | ||
console.debug('Props changed:', props); | ||
return JSON.stringify(props, null, 2); | ||
}, | ||
}, | ||
}; | ||
</script> | ||
|
||
<template> | ||
<section> | ||
<h2 class="vue-heading">Props Testing</h2> | ||
<pre class="props-tester" v-html="propsJSON" /> | ||
</section> | ||
</template> | ||
|
||
<style scoped> | ||
.props-tester { | ||
border: solid 1px #AB47bc; | ||
background-color: #292D3E; | ||
color: #A6ACCD; | ||
font-family: 'Fira Code Retina', 'Source Code Pro', monospace; | ||
font-size: 16px; | ||
border-radius: .25em; | ||
padding: .5em; | ||
margin: 0; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters