update
This commit is contained in:
61
module/Application/view/dashboard/formLog.phtml
Normal file
61
module/Application/view/dashboard/formLog.phtml
Normal file
@ -0,0 +1,61 @@
|
||||
<?php
|
||||
$this->layout('layout/dashboardLayout');
|
||||
?>
|
||||
|
||||
<div id="app">
|
||||
<div class="navbar-form" role="search">
|
||||
<div class="form-group">
|
||||
主键ID:
|
||||
<input v-model="state.searchDataProvider.params" type="text" class="form-control" placeholder="Search">
|
||||
</div>
|
||||
<button type="submit" class="btn btn-default" @click="fetchData">Go!</button>
|
||||
</div>
|
||||
|
||||
<div class="panel panel-default">
|
||||
<!-- Table -->
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>value</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="item in state.dataProvider">
|
||||
<td>{{ item }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
const { createApp, reactive } = Vue
|
||||
|
||||
createApp({
|
||||
setup() {
|
||||
const state = reactive({
|
||||
dataProvider: {},
|
||||
searchDataProvider: {
|
||||
params: '1'
|
||||
}
|
||||
})
|
||||
|
||||
function fetchData() {
|
||||
fetch('/api/dashboard/form-log', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
|
||||
},
|
||||
body: Qs.stringify(state.searchDataProvider)
|
||||
}).then(res => res.json()).then(res => {
|
||||
state.dataProvider = res.data
|
||||
console.log(res)
|
||||
})
|
||||
}
|
||||
return {
|
||||
fetchData,
|
||||
state
|
||||
}
|
||||
}
|
||||
}).mount('#app')
|
||||
</script>
|
||||
Reference in New Issue
Block a user