Git Product home page Git Product logo

Comments (4)

daniel-dx avatar daniel-dx commented on May 18, 2024

Got it, i will test the case as soon as possible

from ncform.

daniel-dx avatar daniel-dx commented on May 18, 2024

I tested the production mode of the project created by vue-cli (webpack v4.28.4) is OK.

But the production mode of vue-element-admin(webpack 4.16.5) is problematic.

I guess it is a problem with webpack or some loaders, finally i found the root cause.

The following is the source code fragment of the ncform-common package.

widget:
                        t.widget ||
                        (function(e) {
                          var t = 'input';
                          switch (e) {
                            case 'boolean':
                              t = 'radio';
                              break;
                            case 'object':
                              t = 'object';
                              break;
                            case 'array':
                              t = 'array';
                              break;
                            default:
                              t = 'input';
                          }
                          return t;
                        })(r),

It is compiled into the following code in the vue-element-admin production mode.

widget: t.widget || "input",

This is the root cause.

So the solution is to explicitly declare the widget as shown below

      {
        type: "object",
        properties: {
          name: {
            type: "string"
          },
          gender: {
            type: "boolean",
            ui: {
              widget: "radio"
            }
          }
        },
        ui: {
          widget: "object",
          widgetConfig: {
            layout: "h"
          }
        }
      }

from ncform.

daniel-dx avatar daniel-dx commented on May 18, 2024

The safest solution is to upgrade webpack and related loaders, but I had no luck to do it successfully for vue-element-admin.

from ncform.

pavellzubkov avatar pavellzubkov commented on May 18, 2024

great!

from ncform.

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.