mirror of
https://github.com/vuejs/vue-cli.git
synced 2026-04-21 11:58:36 -05:00
docs(ui): Plugin action example
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user