Git Product home page Git Product logo

Comments (7)

 avatar commented on May 25, 2024

Thank you for submitting a ticket. It looks like you haven't filled in the issue template properly and thus we might not be able to help you with this one. Please check out issue templates at https://github.com/laraform/laraform/tree/master/.github/ISSUE_TEMPLATE folder and add what's missing. This is an automated message.

from laraform.

yespbs avatar yespbs commented on May 25, 2024

I added a sample PWA app with both normal component and async component. Both fails on Vue CLI 4.
The sample included premium package in premium branch

https://github.com/yespbs/laraform-pwa

Please help me with your suggestions

from laraform.

yespbs avatar yespbs commented on May 25, 2024

any updates?

from laraform.

laraform avatar laraform commented on May 25, 2024

I've installed the https://github.com/yespbs/laraform-pwa repo but I only get a "Welcome to Your Vue.js App" screen. Please provide a working example for the repo with clear steps to initialize or provide the codes (not screenshots) to reproduce the bug according to the issue template.

from laraform.

yespbs avatar yespbs commented on May 25, 2024

from laraform.

laraform avatar laraform commented on May 25, 2024

Ok, now I can see that you are trying to create a wrapper around Laraform component. The right way to do it is this in MyFirstForm:

<template>
  <laraform :form="storedSchema" ref="form$"></laraform>
</template>
<script>
  export default {
    name: 'MyFirstForm',
    data: () => ({
      storedSchema: {
        schema: {
          hello_world: {
            type: 'text',
            label: 'Hello',
            default: 'World',
          },
        },  
        buttons: [
          {
            label: 'Submit',
            class: 'btn-primary',
            disabled() {
              // this.form$ is the root Laraform component
              return this.form$.disabled
            }
          },
          {
            label: 'Reset',
            class: 'btn-light',
            prevent: true,
            onClick() {
              this.form$.reset()
            } 
          }
        ]
      }  
    }),
    mounted() {
      this.$refs.form$.on('submit', () => {
        alert('Submission process started')
      })
    },
    methods: {
      submit() {
        // implement custom solution
        console.log('custom submit logic')
      }
    }
  }
</script>
  • You don't need to add Laraform as a mixin to the wrapper
  • The <laraform> component should be referenced with ref and that's how you can access its .on method.

from laraform.

yespbs avatar yespbs commented on May 25, 2024

That works! great

in my CLI 3 setup the PWA is working fine and I found the beforeMount and mounted is best hook to dynamically change the form schema. Only important knowledge is using the ref, I tried that but not exactly as guided here.

Thanks very much

from laraform.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.