Git Product home page Git Product logo

webinarvuejs's Introduction

webinarVueJS

Project Webinar VueJS HIMIT PENS

webinarvuejs's People

Contributors

aanmfa avatar

Stargazers

Jefry Dewangga avatar

Watchers

 avatar

webinarvuejs's Issues

Mengubah Fungsi Menjadi Properti Penghitung

Hi Mas Aan, terima kasih telah mengirimkan kode belajar Vue.js Fundamental, saya sangat mengapresiasi kerja keras Mas Aan.

Mas juga telah menggunakan kerangka kerja CSS Bootstrap untuk gaya aplikasi pencari teks video YouTube ini. Mas juga sudah membuat fungsi utilitas untuk memformat waktu menjadi lebih mudah dibaca oleh manusia. Luar biasa Mas!

Namun saya ada 1 saran untuk kode yg Mas kirimkan yakni mengubah fungsi utilitas tersebut menjadi fungsi properti penghitung. Pada berkas index.html baris ke 94-107 berikut:

webinarVueJS/index.html

Lines 94 to 107 in d6a11b3

toTimeFormat(detik){
var hours = parseInt(detik / 60 / 60);
var minutes = parseInt(detik / 60 - hours * 60);
var seconds = detik - minutes * 60 - hours * 60 * 60;
var stringValue = "";
if(hours){
stringValue += hours + ":";
if(minutes < 10){
stringValue += "0";
}
}
return stringValue + minutes + ":" + seconds;
},

Kurang lebih jika fungsi tersebut diubah menjadi properti penghitung akan menjadi seperti berikut:

export default {
  computed: {
    toTimeFormat() {
      return (detik) => {
        // Kode di dalam fungsi
        return stringValue + minutes + ":" + seconds 
      }
    }
  }
}

Lebih lanjut mengenai perbedaan fungsi dan properti penghitung dapat Mas baca pada tautan berikut, Dokumentasi Vue.js Bahasa Indonesia - Properti Penghitung.

Semangat Mas! ๐Ÿ˜„

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.