Coder Social home page Coder Social logo

ngx-wujie's Introduction

ngx-wujie

无界微前端angular组件封装

注意: angular项目作为主应用才需要安装此包

使用环境

  • angular 9+

快速上手

安装

npm i ngx-wujie -S

引入

// app.module.ts
+ import { WujieModule } from 'ngx-wujie';
@NgModule({
  imports: [
+   WujieModule
  ],
  bootstrap: [AppComponent]
})
export class AppModule {}

使用

<ngx-wujie
    width="100%"
    height="100%"
    name="xxx"
    [url]="xxx"
    [sync]="true"
    [fetch]="fetch"
    [props]="props"
    (beforeLoad)="onBeforeLoad($event)"
    (beforeMount)="onBeforeMount($event)"
    (afterMount)="onAfterMount($event)"
    (beforeUnmount)="onBeforeUnmount($event)"
    (afterUnmount)="onAfterUnmount($event)"
    (event)="onEvent($event)"
></ngx-wujie>

子应用通过$wujie.bus.$emit(event, args)出来的事件都可以直接(event)来监听

实例方法

destroy()

销毁应用并清空缓存和取消事件

<ngx-wujie #app></ngx-wujie>
<button (click)="app.destroy()">销毁应用</button>

静态属性和方法

import { WujieComponent } from 'ngx-wujie';
const { bus, setupApp, preloadApp, destroyApp } = WujieComponent;

bus

同 API

setupApp

同 API

preloadApp

同 API

destroyApp

同 API

其他

更多参考文档 wujie(无界)

ngx-wujie's People

Contributors

m310851010 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

ngx-wujie's Issues

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.