jgravois
2359
7
Vue

Vue.js data value not updating

Posted 3 years ago by jgravois

This is my component. When editScope(obj) is triggered, the alert fires but I get main.js:15643 Uncaught TypeError: Cannot set property 'workPanel' of undefined in the console and the hidden panel does not appear. Any help is appreciated.

<script type="text/babel">
    export default {
        props: ['scopes'],
        data() {
            return {
                scopes: [],
                search: '',
                workPanel: false
            };
        },
        computed: {},
        completed: () => {},
        created: () => {},
        methods: {
            editScope: (obj) => {
                this.workPanel = true;
                alert('Editing');
            }
        }
    };
</script>

Please sign in or create an account to participate in this conversation.