Hi there! We have the code below but it's not working. I'm not sure why.
<template>
<div>
<iframe
:src="link"
style="height: calc(100vh - 1px); width: 100%; border: none"
frameborder="0"
></iframe>
</div>
</template>
<script>
import Airtable from 'airtable'
const base = new Airtable({ apiKey: process.env.airtableApiKey }).base(
process.env.airtableBaseId
)
export default {
name: 'IndexPage',
data() {
return {
link: '',
}
},
async mounted() {
try {
this.link = await this.getLink(this.$route.query.locationId)
} catch (e) {
console.log(e)
}
},
methods: {
async getLink(locationId) {
try {
const record = await base(process.env.airtableTableName)
.select({ filterByFormula: `{location_id} = "${locationId}"` })
.firstPage()
return record[0].fields.share_url
} catch (error) {
console.log(error)
}
},
},
}
</script>