docs(ui): Plugin action example

This commit is contained in:
Guillaume Chau
2018-04-23 19:35:48 +02:00
parent 9d3fb6bee8
commit 445f79386e
@@ -2,9 +2,34 @@
<div class="test-view">
<h1>I'm a custom view</h1>
<p>A vue-cli plugin created me! I am a dynamically loaded component paired with a custom route.</p>
<div>
<VueButton @click="testPluginAction()">Test plugin action</VueButton>
</div>
</div>
</template>
<script>
export default {
created () {
this.$onPluginActionCalled(action => {
console.log('called', action)
})
this.$onPluginActionResolved(action => {
console.log('resolved', action)
})
},
methods: {
testPluginAction () {
this.$callPluginAction('test-action', {
meow: 'meow'
})
}
}
}
</script>
<style lang="stylus" scoped>
.test-view
padding 42px