抛出和引入

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";
posted @ 2022-04-11 16:54  不叫一日闲过  阅读(130)  评论(0编辑  收藏  举报