Giter VIP home page Giter VIP logo

vue-async-component's Introduction

vue-async-component 异步远端组件

Version License Downloads


用于 vue 项目中通过远程链接加载异步模块(异步模块不随项目一同打包), 依赖 vue v2.4+

Attributes

参数 说明 类型 可选值 默认值
url 组件远程地址 string

Installation

npm:

  npm i vue-async-component -S

基于Node.js的开发环境:

  import SyncComponent from 'vue-async-component';

  <sync-component
    url="http://localhost:8083/static/app.js">
  </sync-component>

浏览器环境:

  <script type="text/javascript" src="SyncComponent.min.js"></script>
  <script type="text/javascript">
    Vue.use(SyncComponent);
  </script>

注意:vue组件没有什么特别限制,唯独在webpack打包过程中需要注意引入项目是否包含当前组件中的依赖,如果有需要排除掉依赖,webpack 配置输出采用 libraryTarget: "var",并且关闭 UglifyJsPlugin 的压缩功能 compress: false, vue-loader v13+ 需要配置 options{ esModule: false }

vue-async-component's People

Contributors

airem-richard avatar luciy avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.