4.0.4 • Published 2 months ago
@ima/plugin-merkur v4.0.4
@ima/plugin-merkur
The @ima/plugin-merkur is for easy integration merkur widget to ima application.
Instalace
npm install @ima/plugin-merkur --save
// /app/build.js
var vendors = {
common: [
'@ima/plugin-merkur'
]
};
Usage
// /app/page/home/HomeController
import { AbstractController } from '@ima/core';
import { MerkurResource } from '@ima/plugin-merkur';
class HomeController extends AbstractController {
/** @type {import('@ima/core').Dependencies} */
static get $dependencies() {
return [MerkurResource];
}
constructor(merkurResource) {
super();
this._merkurResource = merkurResource;
}
load() {
const data = {
containerSelector: '.widget__container',
// When using merkur slot
slot: {
headline: {
containerSelector: '.widget__headline-slot'
}
}
};
const widgetProperties = this._merkurResource
.get('http://localhost:4444/widget', data)
.then((response) => response.body);
return {
widgetProperties
}
}
}
// /app/page/home/HomeView
import React from 'react';
import { MerkurWidget } from '@merkur/integration-react';
class HomeView extends React.Component {
render() {
const { widgetProperties } = this.props;
return (
<div>
<MerkurWidget widgetProperties={widgetProperties}>
<div>Loading phrase</div>
</MerkurWidget>
</div>
);
}
}
4.0.4
2 months ago
4.0.2-rc.2
1 year ago
4.0.2-rc.3
1 year ago
4.0.2-rc.4
1 year ago
4.0.3
1 year ago
4.0.2
1 year ago
4.0.2-rc.0
1 year ago
4.0.2-rc.1
1 year ago
4.0.0-rc.10
1 year ago
4.0.0-rc.9
2 years ago
4.0.0-rc.8
2 years ago
4.0.1
1 year ago
4.0.0
1 year ago
4.0.0-rc.7
2 years ago
4.0.0-rc.3
2 years ago
4.0.0-rc.5
2 years ago
4.0.0-rc.4
2 years ago
4.0.0-rc.6
2 years ago
4.0.0-rc.2
2 years ago
4.0.0-rc.1
2 years ago
4.0.0-rc.0
2 years ago
3.1.2
2 years ago
3.1.1
2 years ago
3.1.0
2 years ago
3.0.0
3 years ago
2.2.0
3 years ago
2.1.1
3 years ago
2.1.0
3 years ago
2.0.1
3 years ago
2.0.0
3 years ago
1.0.2
3 years ago