1. JS的抛出和引入
// 抛出
export default function fn(){}
// 引入
import fn from './test'
// 使用
fn()
// 抛出
export default{
fn(){}
}
// 引入
import test1 from './test1';
// 使用
test1.fn()
// 抛出
export const a = '1';
export const b = '2';
// 引入
import {a, b} from './test2';
// 使用
console.log(a)
2. node CommonJS
// 抛出
module.exports = {
c: 1
}
// 引入
const { c } = require('./test3');
// 使用
console.log(c);
3. css的引入
3.1 行内样式
<div style="color:red"></div>
3.2 内联样式
<style>
bdoy{font-size:14px;}
</style>
3.3 外联样式
<link rel="stylesheet" type="text/css" href="style.css">
3.4 导入式
@import url(index2.css);
@import "sub.css";