Skip to content
This repository has been archived by the owner on May 3, 2018. It is now read-only.

Template serve for multipurpose #1306

Open
weehong opened this issue May 9, 2017 · 0 comments
Open

Template serve for multipurpose #1306

weehong opened this issue May 9, 2017 · 0 comments

Comments

@weehong
Copy link

weehong commented May 9, 2017

Hello everyone,

I would like to know is that possible to use ONE template script to perform add and delete function?

Because I don't want to create a same template to serve the two functions.

<script type="text/x-template" id="category-template">
    <transition name="modal">
        <div class="modal-mask">
            <div class="modal-wrapper d-flex justify-content-center align-items-center">
                <div class="modal-container">

                    <div class="modal-header">
                        <slot name="header">
                        default header
                        </slot>
                    </div>

                    <div class="modal-body">
                    	<form method="POST">
	                        <div class="form-group" :class="{'has-error': errors.has('category') }">
				                <input v-validate="'required'" type="text" class="form-control" name="category" id="category" placeholder="Category name">
				                <span v-cloak v-show="errors.has('category')" class="text-danger">@{{ errors.first('category') }}</span>
				            </div>	
				            <div class="form-group text-center">
				                <button type="submit" class="btn btn-primary">Create</button>
				            </div>
                    	</form>
                    </div>
                </div>
            </div>
        </div>
    </transition>
</script>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant