Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d7646ee

Browse files
committed
fix: allow deepProxy to be used in expressions
1 parent d648a57 commit d7646ee

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

platform/nativescript/util/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,14 @@ export function after(original, thisArg, wrap) {
7777
export function deepProxy(object, depth = 0) {
7878
return new Proxy(object, {
7979
get(target, key) {
80-
if (key === 'toString') {
80+
if (key === 'toString' || key === 'valueOf') {
8181
return () => ''
8282
}
8383

84+
if (key === Symbol.toPrimitive) {
85+
return hint => hint
86+
}
87+
8488
if (depth > 10) {
8589
throw new Error('deepProxy over 10 deep.')
8690
}

samples/app/app-with-list-view.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ new Vue({
4545
4646
<v-template if="item.type === 'page'">
4747
<WrapLayout orientation="horizontal" class="list-group-item active">
48-
<Label :text="item.title" style="color: red;" />
48+
<Label :text="'<<< ' + item.title + ' >>>'" style="color: red;" />
4949
</WrapLayout>
5050
</v-template>
5151

0 commit comments

Comments
 (0)