Vue.component('search-post', {
props: ['result'],
template: '<div class="row list-view" v-html="result"></div>'
})
var app = new Vue({
el: '#last-posts',
data: {
text: '',
result: null,
},
methods: {
articleSearch: function(e) {
var vm = this
axios.get('/search', {
params: {
texts: this.text
}
}).then(function (response) {
console.log(response);
vm.result = response.data
}).catch(function (error) {
console.log(error)
})
}
},
mounted: function (e) {
this.articleSearch(e);
}
})
<search-post :result="result"></search-post>
return $this->renderAjax('articlesearch', [
'dataProvider' => $dataProvider
]);
echo ListView::widget([
'dataProvider' => $dataProvider,
'options' => [
'tag' => false
],
'itemOptions' => [
'class' => 'item',
'tag' => false,
],
'emptyText' => 'Записей не найдено',
'summary' => false,
'itemView' => '_ajaxList',
'pager' => [
'class' => ScrollPager::className(),
'triggerText' => 'Еще',
'noneLeftText' => 'Записей нет',
'spinnerSrc' => '',
'spinnerTemplate' => '',
'enabledExtensions' => [
ScrollPager::EXTENSION_SPINNER,
ScrollPager::EXTENSION_NONE_LEFT,
ScrollPager::EXTENSION_PAGING
],
'eventOnScroll' => 'function() {console.log(1)}',
]
]);
где 2 тут должен быть форма загрузки файлов как тут