Created
July 17, 2015 02:57
-
-
Save iolson/eb10502192c35a93688a to your computer and use it in GitHub Desktop.
Using Vue inside my
This file contains 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
@extends($viewNamespace . '::layouts.master') | |
@section('title', 'Dashboard') | |
@section('page-title', 'Dashboard') | |
@section('page-subtitle', '') | |
@section('content') | |
<div class="box"> | |
<div class="box-body" id="form"> | |
{!! BootForm::open()->post()->action(route('users.index')) !!} | |
{!! BootForm::text('First Name', 'first_name') !!} | |
<div v-repeat="items" class="form-group"> | |
<label for="website_links">Website Link</label> | |
<input type="text" name="website_links[]" class="form-control" id="website_links"> | |
</div> | |
<div class="form-group"> | |
<button v-on="click: add">Add Another Website Link</button> | |
</div> | |
{!! BootForm::close() !!} | |
</div> | |
</div> | |
@stop | |
@section('footer-extras') | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/0.12.7/vue.js"></script> | |
<script> | |
new Vue({ | |
el: '#form', | |
data: { | |
items: [ | |
{} | |
] | |
}, | |
methods: { | |
add: function (e) { | |
e.preventDefault(); | |
this.items.push({}) | |
} | |
} | |
}); | |
</script> | |
@stop |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment