-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
♻️ : extract stack-vars vue component
- Loading branch information
Showing
2 changed files
with
29 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<template id="stack-vars"> | ||
<div> | ||
<div class="form-row align-items-end" v-for="(modVar,modVarIdx) in editableVars" v-if="editableVars.length > 0"> | ||
<div class="form-group col"> | ||
<label for="var-name">{{modVar.name}}: </label> | ||
<input type="text" class="form-control" id="var-name" v-model="stack.variableValues[modVar.name]"> | ||
<small id="emailHelp" class="form-text text-muted">{{modVar.description}}</small> | ||
</div> | ||
</div> | ||
<div v-if="editableVars.length === 0"> | ||
<p>No editable variable defined for this module.</p> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
Vue.component('stack-vars', { | ||
template: "#stack-vars", | ||
props: ["stack", "module"], | ||
computed: { | ||
editableVars: function() { | ||
return this.module.variables.filter(variable => variable.editable); | ||
} | ||
} | ||
}); | ||
</script> |