博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
javascript ES6 class类的创建和调用
阅读量:4303 次
发布时间:2019-05-27

本文共 657 字,大约阅读时间需要 2 分钟。

utils.js

const p = 3function add(a, b) {
return a + b}class Person {
constructor(name, age, sex) {
this.name = name; this.age = age; this.sex = sex; } showInfo() {
console.log(`姓名:${
this.name},年龄:${
this.age},性别:${
this.sex}`); }}class Student extends Person {
constructor(name, age, sex, teacher) {
super(name, age, sex) this.teacher = teacher } showInfo() {
console.log(`姓名:${
this.name},年龄:${
this.age},性别:${
this.sex},我的老师是${
this.teacher}`); }}module.exports = {
add, p, Person, Student,}

my.vue

知识点笔记

class
constructor
this
模版字符串
super
extends
module.exports {
xxx
}
import {
xxx
} from ’ ’

转载地址:http://zzhws.baihongyu.com/

你可能感兴趣的文章
海龟交易法则16_附原版海龟交易法则
查看>>
克罗谈投资策略01_期货交易中的墨菲法则
查看>>
克罗谈投资策略02_赢家和输家
查看>>
克罗谈投资策略03_你所期望的赌博方式
查看>>
克罗谈投资策略04_感觉与现实
查看>>
通向财务自由之路01_导读
查看>>
通向财务自由之路02_成功的决定因素:你
查看>>
中低频量化交易策略研发01_引言
查看>>
中低频量化交易策略研发06_推进的择时策略
查看>>
史丹·温斯坦称傲牛熊市的秘密
查看>>
期货市场技术分析01_理论基础
查看>>
期货市场技术分析02_趋势的基本概念
查看>>
期货市场技术分析03_主要反转形态
查看>>
期货市场技术分析04_持续形态
查看>>
期货市场技术分析05_交易量和持仓兴趣
查看>>
TB交易开拓者入门教程
查看>>
TB创建公式应用dll失败 请检查用户权限,终极解决方案
查看>>
python绘制k线图(蜡烛图)报错 No module named 'matplotlib.finance
查看>>
talib均线大全
查看>>
期货市场技术分析06_长期图表和商品指数
查看>>