- Java 双重比较
- java - 比较器与 Apache BeanComparator
- Objective-C 完成 block 导致额外的方法调用?
- database - RESTful URI 是否应该公开数据库主键?
我有一个困境正在构建一个应用程序来跟踪学生的时间,在一个选项卡中你可以看到学生列表和他们本季度的总小时数,还有一个查看更多按钮可以打开一个对话框“弹出窗口”您显示该特定学生的个人资料。
现在,如果您单击按钮,我将使用“@click="dialog = true"打开对话框,仅此而已!
我的问题是如何将学生 ID 传递到此页面,以便我可以联系 ye API 并获取学生信息
学生视角
<v-data-table :headers="headers"
:pagination.sync="pagination"
:items="filteredResources"
:search="search">
<template slot="items" slot-scope="props">
<td>{{ props.item.sid }}</td>
<td class="text-xs-left">{{ props.item.firstName }}</td>
<td class="text-xs-left">{{ props.item.lastName }}</td>
<td class="text-xs-left">{{ props.item.totalHours }}</td>
<td class="text-xs-left">{{ props.item.reason }}</td>
<td class="text-xs-left">
<v-btn fab dark small
color="primary"
@click="dialog = true">
<v-icon dark>edit</v-icon>
</v-btn>
</td>
</template>
<v-alert slot="no-results" :value="true" color="error" icon="warning">
Your search for "{{ searchQuery }}" found no results.
</v-alert>
</v-data-table>
脚本
<script>
import axios from 'axios'
import StudentProfile from './studentsProfile'
export default {
components: {
'studentsProfile': StudentProfile
},
data() {
return {
pagination: {
rowsPerPage: 25
},
dialog: false,
notifications: false,
sound: true,
widgets: false,
searchQuery: '',
headers: [
{
text: 'SID',
align: 'left',
sortable: false,
value: 'name'
},
{ text: 'Firts Name', value: 'firtsname' },
{ text: 'Last Name', value: 'fat' },
{ text: 'Total Hours', value: 'carbs' },
{ text: 'Reason', value: 'protein' },
{ text: 'View More', value: 'view'}
],
summary: []
}
},
created() {
axios.get('/api/StudentSummary')
.then(response => {
// JSON responses are automatically parsed.
this.summary = response.data
})
.catch(e => {
this.errors.push(e)
})
},
computed: {
filteredResources() {
if (this.searchQuery) {
return this.summary.filter((item) => {
return item.sid.startsWith(this.searchQuery);
//return item.searchQuery.startsWith(this.searchQuery);
//return
item.firstName.toLowerCase().includes(this.searchQuery.toLowerCase())
})
} else {
return this.summary;
}
}
}
}
最佳答案
您可以定义一个名为 editStudent
的方法并将 sid
作为参数传递:
模板:
<v-btn fab dark small
color="primary"
@click="editStudent(props.item.sid )">
方法:
methods:{
editStudent(id){
this.dialog=true;
this.editedSid=id;
}
}
<v-dialog v-model="dialog" width="500">
<v-btn fab dark small color="primary" @click="editStudent(props.item.sid)">
<v-icon dark>edit</v-icon>
</v-btn>
<!-- the dialog conent -->
</v-dialog>
关于javascript - VueJS 将参数传递给 Popup "Dialog",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54095979/
使用的浏览器 - Chrome 67.0.3396.99 我创建了一个 DialogsModule它有一个组件 ConfirmDialog.component.ts使用以下模板 confirm-dia
我一直在尝试制作一个简单的程序来使用Electron创建和读取文件。 到目前为止,我已经尝试了很多,并且似乎没有提供与dialog.showOpenDialog一起提供的回调函数。 dialo
我有一个登录对话框,想防止它在按下回车键时自动关闭。 更具体地说,当用户输入凭据并按下回车键时,凭据的响应返回错误,我希望对话框保留(这样我就可以向他们显示一些错误消息,让用户再试一次) . 这就是我
Jquery对话框的含义是什么:它是单独的网页还是网页的一部分? (我不太了解 Jquery)。 谢谢 最佳答案 jQuery 对话框将出现在页面上方,但它实际上是当前页面的一部分。当您加载对话框时,
当用户退出 xe:dialog 时,我需要做一些清理工作。我将代码放在 onUnload 事件中,如下所示: viewScope.remove("vsSomeVariable"); viewScope
我想相对于我的 html 元素之一定位 Dojo 的 Dijit 对话框。是否可以? 如是。如何? 目前它总是在视口(viewport)中间显示对话框。 有人可以帮我解决这个问题吗? 谢谢。 amar
即使属性设置为“openDirectory”,是否也可以在 showOpenDialog 中显示文件?当然,文件不应该是可选的,但可能会显示为灰色。所以用户知道他选择了正确的目录。在 OSX 上一切正
如何使用 android 标准组件 Bottom Sheet 单实现以下设计功能: 出现 Bottom Sheet 对话框片段时的图像: 用户向上滚动以查看内容底部时的图像: 我将使用 ViewPag
我刚开始使用对话框,我非常喜欢在资源文件中定义布局的可能性。但是是否可以设置一个对话框并将其嵌入到另一个对话框中(即没有 float 对话框)? 对于普通窗口,我创建了一个带有一个子窗口的主窗口。然后
我正在尝试更改 dialog 的背景颜色元素的 backdrop使用自定义 CSS 属性,但不需要。这是 Chrome 中的错误还是有原因? document.querySelector('dialo
我有一个 Electron 应用程序。如果我通常使用dialog.showmessageBoxSync,则必须等待用户输入。选项为:关闭,取消或确定。 它工作正常,但是如果我在对话框外部(应用程序内的
我有一个启动确认对话框的 View ,但代码不是等待对话框返回结果,而是直接跳转到 promise 的“then”部分。请参阅下面的代码: ConfirmDialog.ts import { inje
我有一个启动确认对话框的 View ,但代码不是等待对话框返回结果,而是直接跳转到 promise 的“then”部分。请参阅下面的代码: ConfirmDialog.ts import { inje
我正在使用 MonoTouch.Dialog 的 OwnerDrawnElement,但它似乎不允许用户在触摸屏幕时“突出显示”单元格。我查看了示例,但它没有显示突出显示。有什么建议么? 我注意到 T
此选择器在 http://jqueryui.com/demos/dialog/#modal-confirmation 中引用(源代码)。 $( "#dialog:ui-dialog" ).dialog
我有一个奇怪的问题。当 Activity 开始时,我会显示一个对话框,说明某些项目正在加载,如下所示: Dialog dialog; @Override public void onCreate(Bu
jquery-ui 中 .dialog("close") 和 .dialog("destroy") 有什么区别? 我有一个脚本,以前的开发人员使用了 .dialog("destroy") 但现在我必须
我正在使用 Acengage (Ad4Push),我想自定义它的对话框。 Acengage 团队说可以使用自定义主题更改对话框样式,我做到了。我可以更改 textSize、textColor、wind
我有一个标准 View ,顶部有一个导航栏。我还在它自己的源文件中设置了一个 Monotouch.Dialog。我四处寻找解决方案,但似乎找不到关于如何将 MTD 添加到普通 View 的明确答案。
我试图从一个打开的 md-dialog 中打开一个 md-dialog,但问题是第一个 md-dialog 在第二个打开时关闭了 // the controller of the first popU
我是一名优秀的程序员,十分优秀!