【发布时间】:2018-12-18 04:27:38
【问题描述】:
我正在尝试在使用a vue wrapper 创建的数据源上调用fetch 方法。
错误是 [Vue warn]: Error in mounted hook: "TypeError: this.$refs.datasource.fetch is not a function" 所以我的问题是如何从$refs 对象。
我做了一个stackblitz here
<body>
<div id="vueapp" class="vue-app">
<kendo-datasource ref="datasource" :data="dataSourceArray">
</kendo-datasource>
</div>
</body>
new Vue({
el: '#vueapp',
data: function() {
return {
dataSourceArray: [
{ text: 'Albania', value: '1' },
{ text: 'Andorra', value: '2' },
{ text: 'Armenia', value: '3' },
{ text: 'Austria', value: '4' },
{ text: 'Azerbaijan', value: '5' },
{ text: 'Belarus', value: '6' },
{ text: 'Belgium', value: '7' }
]
}
},
mounted: function () {
this.$refs.datasource.fetch()//<== error here
}
})
【问题讨论】:
标签: javascript vue.js kendo-ui kendo-ui-vue