Commit 82833458 authored by Markus Opolka's avatar Markus Opolka
Browse files

Add better Feature design

parent faa601ea
<template>
<ul style="list-style-type:none; padding:5px;">
<ul style="list-style-type:none; padding:8px;">
<template v-for="(child, name) in root">
<li><v-chip outline color="secondary">{{name}}</v-chip>
<li><v-chip label outline color="blue darken-4">{{capitalize(underscore(name))}}</v-chip>
<span v-if="isText(child)"> {{child._text}}</span>
<ul v-if="isFeature(child)" style="list-style-type:none; padding:5px;">
<li v-for="attr in child.feature">
......@@ -35,13 +35,19 @@
<script>
export default {
// Recursive Component for Features in a Letter
// { "category": "bittfloskel", "type": "abgewandelt", "ref": "9 10 11" }
data () {
return {
data: null
}
},
methods: {
capitalize (str) {
// Capitalize first letter of a String
return str.replace(/\w\S*/g, function (txt) { return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase() })
},
underscore (str) {
return str.replace(/_/g, ' ')
},
isAttribute (obj) {
return Object.keys(obj)[0] === '_attributes'
},
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment