Code Monkey home page Code Monkey logo

Comments (5)

africa1207 avatar africa1207 commented on June 13, 2024

呼叫大佬@lhbxs @siyi98 @tw93

from x-render.

lhbxs avatar lhbxs commented on June 13, 2024

是的,drawerList 这种模式比较特殊。弹窗里面其实是一个新的 FormRender 实例,只有在点击确定的时候才会进行数据同步,触发 watch

from x-render.

lhbxs avatar lhbxs commented on June 13, 2024

#1504

from x-render.

lhbxs avatar lhbxs commented on June 13, 2024

已修复

from x-render.

africa1207 avatar africa1207 commented on June 13, 2024

是的,drawerList 这种模式比较特殊。弹窗里面其实是一个新的 FormRender 实例,只有在点击确定的时候才会进行数据同步,触发 watch

@lhbxs 你好,那我如何实现drawerList中的字段联动呢如描述中将选中项的price字段赋值给input1

 const watch = {
    "list[].select1": (value, indexList) => {
      console.log("value", value);
      console.log("indexList", indexList);
      // 无效
      form.setValueByPath(`list[${indexList[0]}].input1`, 123); 
      // 无效
       form.setValueByPath(`list[].input1`, 123); 
    },
  };

我直接在select的onChange中也不行

select1: {
              title: "单选",
              type: "string",
              widget: "select",
              props: {
                options: [
                  {
                    label: "选项a",
                    value: "a",
                    price: 100,
                  },
                  {
                    label: "选项b",
                    value: "b",
                    price: 200,
                  },
                  {
                    label: "选项c",
                    value: "c",
                    price: 300,
                  },
                ],
                onChange: (value, _) => {
                  form.setValueByPath("list[].input1", _.price);
                },
              },
            },
          }

from x-render.

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.