将公共功能封装起来使用,如轮播图
<script>
// 插件 轮播图 plugin 把公用性功能封装起来
// 定义插件 myPlugin
const myPlugin = {
// 固定格式
// 传递两个参数 一个根节点 app 一个options
install(app, options) {
// provide
app.provide('name', 'Dell pc');
// directive
app.directive('my-focus',{
mounted(el