first commit
This commit is contained in:
45
wp-content/themes/ostal_WP/ostal-front/vue-slider.js
Normal file
45
wp-content/themes/ostal_WP/ostal-front/vue-slider.js
Normal file
@@ -0,0 +1,45 @@
|
||||
|
||||
var app = Vue.createApp({
|
||||
el: '#app',
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
index: 0,
|
||||
items: [],
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
async created() {
|
||||
|
||||
},
|
||||
mounted() {
|
||||
fetch('http://localhost/ostal/wp-json/wp/v2/realizacje')
|
||||
fetch()
|
||||
.then(res => res.json())
|
||||
.then(data => this.items = data)
|
||||
|
||||
// this.createImageArr();
|
||||
},
|
||||
methods: {
|
||||
showImg(index) {
|
||||
this.index = index
|
||||
this.visible = true
|
||||
},
|
||||
handleHide() {
|
||||
this.visible = false
|
||||
},
|
||||
|
||||
},
|
||||
computed: {
|
||||
images() {
|
||||
return this.items.map(item => item.acf.zdjecia.map(photo => photo.sizes.large))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
})
|
||||
|
||||
|
||||
app.use(VueEasyLightbox)
|
||||
app.mount('#app')
|
||||
Reference in New Issue
Block a user