本文共 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/