当前位置:网站首页>ES: export 的用法
ES: export 的用法
2022-08-02 16:59:00 【amadeus_liu2】
- 在lib目录下定义一个js(math.js)
export function sum(x, y) {
return x + y;
}
export var pi = 3.141593;
export default function(x) {
return Math.exp(x);
}
- 在另一个vue文件里使用
首先导入:
import myExp ,{pi} from "./lib/math";
然后使用:
console.log(myExp(pi));
边栏推荐
猜你喜欢
![[300+ selected big factory interview questions continue to share] Big data operation and maintenance sharp knife interview questions column (10)](/img/cf/44b3983dd5d5f7b92d90d918215908.png)
[300+ selected big factory interview questions continue to share] Big data operation and maintenance sharp knife interview questions column (10)

土巴兔IPO五次折戟,互联网家装未解“中介”之痛

分类实验报告作业

金仓数据库 OCCI 迁移指南(4. KingbaseES 的 OCCI 迁移指南)

Coordinate knowledge in digital twin campus scenarios

【300+精选大厂面试题持续分享】大数据运维尖刀面试题专栏(十)

Alibaba最新神作——1015页分布式全栈手册太香了

Pytest学习笔记

LeetCode·每日一题·

Real-time data warehouse architecture evolution and selection
随机推荐
SQL Statement Basics
数字孪生园区场景中的坐标知识
Special Variables (SQL)
MYSQL一站式学习,看完即学完
Flink SQL builds real-time data warehouse DWD layer
Locking and concurrency control (a)
一些与开发者体验有关的话题
Switch 块、Switch 表达式、Switch 模式匹配,越来越好用的 Switch
边界访问的空间权限
Numpy那些事
golang刷leetcode动态规划(8)盈利计划
NoSQL之redis缓存雪崩、穿透、击穿概念解决办法
MySQL常见函数
2022年PMP考试应该注意些什么?
Locking and Concurrency Control (3)
使用lodash替换js字符串中的变量
牛津硕士进碳圈,高瓴红杉经纬一起投了
[C Language Brush Questions] Three Questions for Getting Started with Pointers | String Length, String Copy, Two Number Swap
When Oracle analyzes the archive log content, it finds many nulls?
Oracle分析归档日志内容时,发现很多null?