0

Можно ли обратиться к элементу напрямую (типо this.el), а не городить, как в примере ниже?

var app = new Vue({
        el: '#sidebar',
        data: {
            leftCoordinate: document.getElementById('sidebar').offsetTop,
            topCoordinate: document.getElementById('sidebar').offsetLeft,
        },

1 ответ 1

1

Попробуйте вот так: this.$root.$el

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.