Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[solved] a question about new item added showing wrong color #24

Open
zhengfen opened this issue Apr 17, 2019 · 0 comments
Open

[solved] a question about new item added showing wrong color #24

zhengfen opened this issue Apr 17, 2019 · 0 comments

Comments

@zhengfen
Copy link

zhengfen commented Apr 17, 2019

<template>
                <tr v-for="(item, index) in items" :key="item.id">
                    <td>
                        <switches v-model="item.paid" :emit-on-mount="false" @input="togglePaid(item)" theme="bootstrap" :color="color(item.paid)"></switches>
                    </td>
</template>
<scripts>
            color(value){
                return value? 'success':'default'; 
            },
            add(item){
                this.items.unshift(item);
                this.hide_add_modal();
            },
</scripts>

when a new item is unshifted into items, even if the value is set false, the color is green 'success', but once reload the page, the color becomes default as expected.
solved: as dataForm send 'false' as string...

@zhengfen zhengfen changed the title a question about new item added showing wrong color [solved] a question about new item added showing wrong color Apr 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant