<script>
export default {
  name: 'HelloWorld'
}
$(function () {
  alert('引入成功')
})
</script>
1、export的使用
比喻index.js要使用test.js中的数据,首先在test.js文件中进行导出操作

代码如下:
export function list()
{
    alert("list");
}
export function info()
{
    alert("info");
}
export  let a=10;在index.js文件进行导入操作

代码如下:
<template>
  <div>
    <div v-show="show">HelloWorld</div>
    <button @click="handleClick">Click</button>
  </div>
</template>
<script>
import {list} from '@/components/common.js'
export default {
  name: "test",
  data() {
    return {
      show: true
    };
  },
  methods: {
    handleClick: function() {
      list();
    }
  }
};
</script>2、export default的使用
test.js文件

index.js文件中:

注意:
一个js文件是可以有多个 export
但是一个js文件中只能有一个export default
我们找到在vue的学习和使用中经常会看到这样的一个符号$(美元符号),那么很多人就可能产生了疑惑,这个符号有什么作用呢,其实也不难理解,这个是为了区分vue中的自带的实例和用户自定义的属性而已.












![[MySQL]MySQL用户管理](https://img-blog.csdnimg.cn/img_convert/bc2ec15e195617e2974468e0afd19359.png)






