expression

The expression to pass into the directive.

vuenit.directive('test', { expression : '1===1' });

would output

v-test="1===1"

You can use this in conjunction with props to use variables as well.

vuenit.directive('test', {
  expression : 'x===y',
  props : {
    x : 1,
    y : 1
  }
});

This would allow you to then update the props and re-test the expression.

props.y = 2;
vm.$nextTick(() => {
  vm.$el.outerHTML // would reflect any changes made by the directive
});

results matching ""

    No results matching ""