build

You can build a configuration object using vuenit.build to make a resuable mount method.

const mount = vuenit.build(Component, {
  props : {
    id : 123,
    flag : true
  }
});

You can then call the resulting method to create an instance using those options:

let vm1 = mount();
let vm2 = mount();

You can specify more options that will be merged into the original:

let vm = mount({
  inject : {
    someService : {}
  }
});

You can even provide partial options that will be merged into the original options:

let vm = mount({
  props : {
    flag : false
  }
});

vm.id === 123
vm.flag === false

And you can create new builds from existing ones:

let mount2 = mount.build({
  props : {
    id : 456
  }
});

let vm = mount2();

results matching ""

    No results matching ""