我正在尝试从vue-select中获取选定的值,但是已经使用了所有方法并搜索了帮助,但是这可以正常工作,在页面加载时也会触发警报
Vue.component('v-select', VueSelect.VueSelect)
new Vue({
el: '#app',
data: {
options: [
{id: 1, label: 'foo'},
{id: 3, label: 'bar'},
{id: 2, label: 'baz'},
],
selected: '',
},
methods: {
runme: function() {
alert(this.selected);
}
}
})Run Code Online (Sandbox Code Playgroud)
body {
font-family: 'Source Sans Pro', 'Helvetica Neue', Arial, sans-serif;
}
h1 {
font-size: 26px;
font-weight: 600;
color: #2c3e5099;
text-rendering: optimizelegibility;
-moz-osx-font-smoothing: grayscale;
-moz-text-size-adjust: none;
}
#app {
max-width: 30em;
margin: 1em auto;
}Run Code Online (Sandbox Code Playgroud)
<script src="https://vuejs.org/js/vue.js"></script>
<script src="https://unpkg.com/vue-select@2.4.0/dist/vue-select.js"></script>
<div id="app">
<h1>Vue Select - Using …Run Code Online (Sandbox Code Playgroud)我正在使用数据表为我的所有表提供 jquery 数据表的魔力,我通过将数据标题添加到我的 td 来制作我的响应表。如何将数据标题添加到我所有的 td 中,使它们看起来像这样
<td data-title="Fruit">Apple</td>
<td data-title="Good or bad">They are delicious</td>
Run Code Online (Sandbox Code Playgroud)
等等...
我目前有这个
$(document).ready(function() {
$('#contacts').DataTable( {
"processing": true,
"serverSide": true,
"ajax": "src/data.php?form_action=get-table",
} );
});
Run Code Online (Sandbox Code Playgroud)
我的返回 json 看起来像这样
{
"draw":"1",
"recordsTotal":2,
"recordsFiltered":2,
"data":[
[
"Apples",
"They are delicious",
"2016-10-10 07:47:12",
"New entry",
"1"
],
[
"Bananas",
"They are also delicious",
"2016-10-10 07:47:12",
"New entry",
"2"
]
]
}
Run Code Online (Sandbox Code Playgroud)