🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
# let/var/const/全局变量 let title = 'title' var title = 'title' const TITLE = 'Hello World' window.title = 'My Blog' 导入在 package.json 中定义的 import Vue from 'vue' import Router from 'vue-router' // @代表源代码目录 import SayHi from '@/views/SayHi' export default { } // lib/math.js ` export function sum(x, y) { return x + y } export var pi = 3.14 ` // app.js import * as math from 'lib/math' math.sum(math.pi, math.pi) //other_app.js import {sum, pi} from 'lib/math' sum(pi, pi) <script> export default { data() { return {} } } </script> 等价代码: <script> export default { data: function() { return {} } } </script> 箭头函数 .then(res => ...); .then(function (res) { }) let title = 'title' {title : title} 等价代码 {title}