86

优雅的类写法

 5 years ago
source link: https://juejin.im/post/5b50c8b76fb9a04fd3439215
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
前言 虽然现在已经是ES6的时代,但是,还是有必要了解下ES5是怎么写一个类的。 本文详述JavaScript面向对象编程中的类写法,并分步骤讲述如何写出优雅的类。 一、例子 例子为一个轻提示组件Toast。 需要实现的功能: on方法,显示提示 off方法

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK