@axelspringer/mango-pagemanager
Mango Page Manager
7,694
| Install | |
|---|---|
npm install @axelspringer/mango-pagemanager@1.1.0-9 |
|
| Latest Version: | 1.1.0-9 |
| Vue: | 2 |
| License: | MIT |
| Last Updated: | Sep 26, 2018 |
| Links: | npm |
Maintainer: andreasprang
:smiley_cat: Mango Page Manager
Getting Started
requires a
nodeversion >= 6 and annpmversion >= 3.x.x
we do provide a
helpcommand to display all possible arguments
# Install the base package and the plugin (could also be global -g)
npm i @axelspringer/mango-pagemanager
Usage
Create a pagemanager.ts file with the following content.
import Vue from 'vue'
import IFrame from '../components/post'
import MangoPageManager from '@axelspringer/mango-pagemanager'
// use pagemanager
Vue.use(PageManager)
export default new PageManager({
blocks: [
{
pageBlock: 'inline_frame',
component: iFrame
}
]
})
This configures the Page Manager to map a page block to a component.
import { Vue, Component } from 'vue-property-decorator'
import HOME_QUERY from '../../graphql/home.graphql'
@Component
export default class Home extends Vue {
/**
*
*/
public blocks = []
/**
* Render function
*
* @param h
*/
public render() {
return (
<main class='start'>
<pagemanager-renderer blocks={this.blocks || []} />
</main>
)
}
}
The pagemanager exposes $pageblock on the component with the page block data to render. You have to add a name property. This is the property on which the Page Manager data and blocks are matched.
import { Vue, Component } from 'vue-property-decorator'
export function renderInnerHtml(h, atts) {
return atts.map(att => h('iframe', { attrs: att.value }))
}
@Component({
name: 'iFrame'
})
export default class iFrame extends Vue {
public render(h) {
if (!this.$pageblock) return null
return (<div>{renderInnerHtml(h, this.$pageblock)}</div>)
}
}
License
MIT
Related Packages
Version History
Pre-releases (188)
| Version | Released | Vue | License |
|---|---|---|---|
| 1.1.0-9 | ^2.5.16 | MIT | |
| 1.1.0-8 | ^2.5.16 | MIT | |
| 1.1.0-7 | ^2.5.16 | MIT | |
| 1.1.0-6 | ^2.5.16 | MIT | |
| 1.1.0-5 | ^2.5.16 | MIT | |
| 1.1.0-4 | ^2.5.16 | MIT | |
| 1.1.0-3 | ^2.5.16 | MIT | |
| 1.1.0-2 | ^2.5.16 | MIT | |
| 1.0.0-beta.121 | ^2.5.16 | MIT | |
| 1.0.0-beta.120 | ^2.5.16 | MIT | |
| 1.0.0-beta.119 | ^2.5.16 | MIT | |
| 1.0.0-beta.116 | ^2.5.16 | MIT | |
| 1.0.0-beta.115 | ^2.5.16 | MIT | |
| 1.0.0-beta.114 | ^2.5.16 | MIT | |
| 1.0.0-beta.113 | ^2.5.16 | MIT | |
| 1.0.0-beta.112 | ^2.5.16 | MIT | |
| 1.0.0-beta.111 | ^2.5.16 | MIT | |
| 1.0.0-beta.110 | ^2.5.16 | MIT | |
| 1.0.0-beta.109 | ^2.5.16 | MIT | |
| 1.0.0-beta.106 | ^2.5.16 | MIT | |
| 1.0.0-beta.105 | ^2.5.16 | MIT | |
| 1.0.0-beta.104 | ^2.5.16 | MIT | |
| 1.0.0-beta.103 | ^2.5.16 | MIT | |
| 1.0.0-beta.102 | ^2.5.16 | MIT | |
| 1.0.0-beta.101 | ^2.5.16 | MIT | |
| 1.0.0-beta.100 | ^2.5.16 | MIT | |
| 1.0.0-beta.99 | ^2.5.16 | MIT | |
| 1.0.0-beta.98 | ^2.5.16 | MIT | |
| 1.0.0-beta.97 | ^2.5.16 | MIT | |
| 1.0.0-beta.96 | ^2.5.16 | MIT |
Showing the latest 30 of 188. See every release on npm
