# 安装/升级依赖

npm install [email protected]

# 全局定义

# 1.扩展原生JS对象

在main.js(入口文件)中添加如下代码:

import {install} from "sjfx";
install();

# 2.layer注入

# App.vue PC端(Element-ui)

import {layerInit} from "sjfx/pc";

export default {
  name: "app",
  created() {
	layerInit(this);
  }
}

# App.vue 移动端(vux)

<template>
  <div id="app">
    <router-view></router-view>
    <layer-init></layer-init>
  </div>
</template>

<script>
  import LayerInit from "sjfx/mobile/layerInit";
  export default {
    name: 'app',
    components: {LayerInit},
  }
</script>
Last Updated: 1/14/2020, 12:00:52 PM