We are using Vue.js, very nice framework if you ask me. From Knockout.js and WPF I know that a context can be specified for the bindings. How can this be done with Vue.js?
See the example below. Here binding-context
is pseudo code for the functionality I am looking for in Vue.
Vue.component('hosting-setup', {
template:
'<wizard>' +
'<wizard-step binding-context="step1" :title="title">' +
'<select :options="choices"></select>' +
'</wizard-step>' +
'<wizard-step binding-context="step2" :title="title">' +
'<select :options="choices"></select>' +
'</wizard-step>' +
'</wizard>',
data: function () {
return {
step1: {
title: 'Choose virtualization software',
choices: ['Virtual Box', 'VMWare'],
choice: undefined,
},
step2: {
title: 'Choose guest operating system',
choices: ['Debian 6', 'Ubuntu 16', 'Windows Server 2012'],
choice: undefined
}
};
}
});