petite-vue
petite-vue copied to clipboard
Add `$root` refer to component root element
Some times like in dialogs we need access to root component from child nodes, also it is a way to access root element from v-scope
. the next snippet from another PR to expose $el
to scope, but this PR can solve the same problem also
<textarea
v-scope="{width: $root.offsetWidth, height: $root.offsetHeight}"
@click="width = $el.offsetWidth; height = $el.offsetHeight;"
>
{{ width }} × {{ height }}
</textarea>