사실 저는 Dexie + VueJs를 사용하고 있으며 레코드 목록이있는 테이블을 인쇄하고 종속 레코드를 계산하기위한 필드를 추가로 인쇄하고 있습니다. 그러나 어떻게해야합니까? 깔끔한 방법.Dexie에서 Vue로 데이터를 동 기적으로 전달하는 방법은 무엇입니까?
내가 뭘하려는 있습니다 :
var vueElement = new Vue({
el: '#myElement',
data: {
states: []
},
computed: {
cities: function (s) {
return db.cities.where('stateId').equals(s.id).count(); // How can I do this?
}
}
});
// Initialize states in vue object
db.states.toArray().then(function (arr) {
vueElement.states = arr;
});
죄송가 익숙하지 도움이되기를 바랍니다? – Austio
'computed' 속성 대신'methods'를 사용해보십시오. – Saurabh
@Austio 예, 약속을 반환합니다. – robregonm