0
このテーブル行で選択したアイテムはどのように取得されますか。私は欲しい行をクリックすると私に牛が与えられ、次に私はそれを使うことができます。多くの変更を加えることなく、これを非常に簡単な方法で行うことができる方法はありますか?テーブルの行がVueテーブル行からIDを取得
<script>
//class initialization
var ArtificialInsemination = new Vue({
el:'#ArtificialInsemination',
data: {
url:'http://localhost/dairyfarm/index.php',
artificialInseminationRecords: [],
cowId: ''
},
//invoke methods
methods: {
viewRecords:function() {
var data = new FormData()
data.append('function','viewRecords')
axios.post(this.url,data)
.then(function (response) {
this.artificialInseminationRecords = response.data.data
}.bind(this)).catch(function (error) {
})
}, saveInseminationRecords:function() {
var data = new FormData()
data.append('function','saveInseminationRecords')
axios.post(this.url,data)
.then(function (response) {
this.artificialInseminationRecords = response.data.data
}.bind(this)).catch(function (error) {
})
}, DeleteArtificialInseminationRecords:function() {
this.cowId = 'GET COW ID HERE'
var data = new FormData()
data.append('function','DeleteArtificialInseminationRecords')
data.append('cowId',this.cowId)
axios.post(this.url,data)
.then(function (response) {
}.bind(this)).catch(function (error) {
})
},
create: function(){
this.viewRecords()
}.bind(this),
}
})
</script>
@LaureenToroitchありがとう受け付けます。 – WaldemarIce