Answer the question
In order to leave comments, you need to log in
What is the correct way to write a computed property?
Hello, I've run into this problem. You need to write a calculated property in vue.js that will take the width of the block, then do the calculation (width / 2 * (-1)) and apply the result to the margin-left property of the block. I know that it will sound strange, but I know how to solve this question on Jquery and pure js, here is an example on Jquery:
jQuery(document).ready(function($) {
var width = $('.ucp').width();
$('.ucp').css('margin-left', width / 2 * (-1) );
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question