Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose $el to v-scope #147

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Expose $el to v-scope #147

wants to merge 1 commit into from

Commits on Mar 11, 2022

  1. Expose $el to v-scope

    This small change allows one to use element properties as values for props defined in `v-scope`... I'm finding it makes for a nice shorthand when trying to define such props on mount. For a toy example:
    ```
    <textarea
    	v-scope="{width: $el.offsetWidth, height: $el.offsetHeight}"
    	@click="width = $el.offsetWidth; height = $el.offsetHeight;"
    >{{ width }} &times; {{ height }}</textarea>
    ```
    vs. currently:
    ```
    <textarea
    	v-scope="{width: null, height: null}"
    	@VUE:mounted="width = $el.offsetWidth; height = $el.offsetHeight;"
    	@click="width = $el.offsetWidth; height = $el.offsetHeight;"
    >{{ width }} &times; {{ height }}</textarea>
    ```
    jhuddle authored Mar 11, 2022
    Configuration menu
    Copy the full SHA
    424ef04 View commit details
    Browse the repository at this point in the history