Created
April 14, 2018 09:26
-
-
Save MarGul/bc7ba9e0c7d94f601df80a7a9092313d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// show.blade.php | |
@foreach( $arguments as $argument ) | |
<argument :argument="{{ json_encode($argument) }}" > | |
<p>{{ $argument['text'] }}</p> | |
</argument> | |
@endforeach | |
// Argument.vue | |
<template> | |
<div class="bg-white p-4"> | |
<slot></slot> | |
<p> | |
{{ count }} <button type="button" @click="increment">Increment</button> | |
</p> | |
</div> | |
</template> | |
<script> | |
export default { | |
name: 'Argument', | |
props: { | |
argument: { | |
type: Object, | |
required: true | |
} | |
}, | |
data() { | |
return { | |
count: this.argument.count | |
} | |
}, | |
methods: { | |
increment() { | |
this.count++; | |
} | |
} | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment