question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

It would be nice to be able to use html in the JSON schema

I don’t think this is possible at the minute so correct me if it is, but it would be really nice to be able to add html into the JSON when generating forms so that custom styling can be applied. Example below.

  {
    "component": "h3",
    "children": "Student <strong>registration</strong>"
  },
  {
    "label": "Your name",
    "name": "name",
    "validation": "required"
  },
  {
    "label": "Your email",
    "name": "email",
    "help": "Please use your student email address",
    "validation": "bail|required|email|ends_with:.edu",
    "validation-messages": {
      "ends_with": "Please use a .edu email address"
    }
  },
  {
    "label": "Student ID",
    "name": "student_id",
    "help": "Your 6 digit student ID (ex. ST-123421)",
    "placeholder": "ST-",
    "validation": "^required|matches:/^ST-[\\d]{6}$/",
    "validation-name": "Student ID"
  },
  {
    "type": "submit"
  }
]

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
sugoidesunecommented, Nov 13, 2020

Schema:

          {
             type:"html",
             html:"<b>love</b>"
          }

Component formulate-html.vue:

<template>
    <div v-html="html">
    </div>
</template>
<script>
export default {
      props: ['html']
}
</script>

Registration in VueFormulate Config:

import Vue from 'vue'
import VueFormulate from '@braid/vue-formulate'
import FormulateHTML from '~/components/formulate-html'

Vue.component('FormulateHTML', FormulateHTML)

Vue.use(VueFormulate, {
    library:{
      html:{
        classification: 'html',
        component: 'FormulateHTML',
        slotProps: {
          component: ['html']
        }
      }}})
0reactions
justin-schroedercommented, Nov 20, 2020

Looks like you guys have found a good way around this so im going to close it out for now. Again, would love to see a plugin develop here 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting started with schema.org using Microdata
Schema.org is a set of extensible schemas that enables webmasters to embed structured data on their web pages for use by search engines...
Read more >
What Is Schema Structured Data And How To Implement It - Moz
Schema.org (often called schema) is a semantic vocabulary of tags (or microdata) that you can add to your HTML to improve the way...
Read more >
How to Boost Your SEO by Using Schema Markup - Neil Patel
Schema Markup Uses a Unique Semantic Vocabulary in Microdata Format. You don't need to learn any new coding skills. Web pages with markup...
Read more >
WebSchemas - W3C Wiki
Web Schemas was a W3C group used by the schema.org project to collaborate with the wider community. The group is not just for...
Read more >
Microdata - HTML: HyperText Markup Language | MDN
Google and other major search engines support the Schema.org vocabulary for structured data. This vocabulary defines a standard set of type ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found