1. 程式人生 > >5、模塊化

5、模塊化

ons efault pre mod true cti () console fault

1、

import export

export let A = 123;

export function test () {
  console.log(‘test‘)
}

export class Hello {
  test () {
    console.log(‘class‘)
  }
}
import {A,test,Hello} from ‘@/utils/module.js‘ 2、
let A = 123;

let test = function () {
  console.log(‘test‘)
}

class Hello {
  test () {
    console.log(‘class‘)
  }
}

export default {
  A,
  text,
  Hello
}
import obj from ‘@/utils/module.js‘

5、模塊化