Skip to content

Instantly share code, notes, and snippets.

@swt02026
Created November 14, 2016 08:04
Show Gist options
  • Save swt02026/f2afa916acacc6290c701f315d1b86ce to your computer and use it in GitHub Desktop.
Save swt02026/f2afa916acacc6290c701f315d1b86ce to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="https://unpkg.com/vue/dist/vue.js"></script>
</head>
<body>
aaaaa
<div id="selected-list" class="container">
<form action="admin/crud/borrow.php" method="post">
<{foreach from=$query_rows item=row}>
<div class="col-md-6 col-sm-6">
<div class="well well-sm">
<div class="row">
<div class="col-md-4 col-sm-4">
<img src="" alt="無圖檔" class="img-responsive">
</div>
<div class="col-md-8 col-sm-8">
名稱:<{$row.name}><br />
持有人:<{$row.owner}><br />
數量:<{$row.amount}><br />
<div class="form-group">
<label for="borrow<{$row.id}>">借用數量:</label>
<input id="borrow<{$row.id}>"
class="form-control"
type="number"
name="borrow_number[<{$row.id}>]"
min="0"
max="<{$row.amount}>"
v-on="change: append"
>
</div>
</div>
</div>
</div>
</div>
<{/foreach}>
<button type="button" class="btn btn-lg" data-toggle="modal" data-target="#submitModal">送出</button>
<div class="modal fade" id="submitModal" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button data-dismiss="modal" class="close">&times;</button>
<h4 class="modal-title">借用確認</h4>
</div>
<div class="modal-body">
<p>名稱:<br />借用數量:<br /></p>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-lg">確認送出</button>
<button data-dismiss="modal" class="btn btn-lg">取消</button>
</div>
</div>
</div>
</div>
</form>
</div>
<script>
new Vue({
el: '#selected-list',
data:{
items:[
]
},
methods:{
append: function () {
console.log("aaa");
}
}
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment