Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamically add simplified css names for all components #169

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions fragments/block/template.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,16 @@
// this.$refs.anchor.style.paddingTop = `${navOffset}px`

},
computed: {
computed: {
videoSource() {
return this.loadVideo ? this.model.bgvideo + '?autoplay=1&loop=1&controls=0&mute=1' : "";
},
classes: function() {
let classObject = {}
classObject['min-h-screen'] = this.model.fullheight == 'true'
classObject[`elevation-${this.model.elevation}`] = this.model.elevation > 0
return classObject
console.log('1', this.model.extraclasses)
return classObject
},
colors: function() {
let classes = {};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<component class="w-full px-5 flex flex-col justify-center" ref="section"
v-bind:class="[classes, colors, model.component, model.extraclasses]" v-bind:style="[styles, sticky]"
v-bind:class="[classes, colors, model.component, simpleComponentClass, model.extraclasses]" v-bind:style="[styles, sticky]"
v-bind:data-per-path="model.path" v-bind:is="model.htmlelement || &quot;div&quot;"
v-bind:id="model.anchorname">
<div class="embed-responsive embed-responsive-16by9 w-full h-full top-0 left-0"
Expand Down Expand Up @@ -52,15 +52,21 @@
// this.$refs.anchor.style.paddingTop = `${navOffset}px`

},
computed: {
computed: {
videoSource() {
return this.loadVideo ? this.model.bgvideo + '?autoplay=1&amp;loop=1&amp;controls=0&amp;mute=1' : "";
},
classes: function() {
let classObject = {}
classObject['min-h-screen'] = this.model.fullheight == 'true'
classObject[`elevation-${this.model.elevation}`] = this.model.elevation > 0
return classObject

return classObject
},
simpleComponentClass() {
const classPieces = this.model.component.split('-')
classPieces.splice(0,1)
return classPieces.join('-')
},
colors: function() {
let classes = {};
Expand Down