mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-18 06:44:46 -07:00
Make ad stateless again
This commit is contained in:
parent
d882191df8
commit
9e817f0f6c
1 changed files with 6 additions and 12 deletions
|
|
@ -38,8 +38,6 @@
|
|||
/* Carbon ads */
|
||||
import CarbonInline from './carbon-inline.vue'
|
||||
|
||||
const transparentImage = 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7'
|
||||
|
||||
const ads = {
|
||||
// Since Vue renders the ad on the server
|
||||
// but destroys the ad when hydrating on
|
||||
|
|
@ -48,7 +46,7 @@ const ads = {
|
|||
// and so that our ad css still get's imported.
|
||||
'placeholder': {
|
||||
url: '/',
|
||||
imageSrc: transparentImage,
|
||||
imageSrc: 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7',
|
||||
imageAlt: '',
|
||||
copy: '',
|
||||
corner: '',
|
||||
|
|
@ -98,16 +96,9 @@ export default {
|
|||
default: () => ({})
|
||||
}
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
// We store imageSrc in data
|
||||
// so that vue knows to update attribute after hydration.
|
||||
imageSrc: transparentImage,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
adName () {
|
||||
// console.log( 'kindName', this.page?.kindName )
|
||||
console.log( 'kindName', this.page?.kindName )
|
||||
|
||||
if ( this.name === 'placeholder' ) {
|
||||
return 'placeholder'
|
||||
|
|
@ -122,10 +113,13 @@ export default {
|
|||
},
|
||||
ad () {
|
||||
return ads[ this.adName ]
|
||||
},
|
||||
imageSrc () {
|
||||
return this.ad.imageSrc
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
this.imageSrc = this.ad.imageSrc
|
||||
console.log( 'mounted', this.adName )
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue