Code Monkey home page Code Monkey logo

qscmf-builderitem-checkbox-text's Introduction

qscmf-builderitem-checkbox-text

checkbox-text builder组件

效果截图

安装

composer require quansitech/qscmf-builderitem-checkbox-text

如何使用

  • FormType

    // title: 选项标题
    // key: 选现对应的键值
    // need_text 是否需要填写额外的文本项
    $option = [
      [
          'title' => '网站开发',
          'key' => 1,
      ],
      [
          'title' => '公众号运维',
          'key' => 2,
      ],
      [
          'title' => '其他',
          'key' => 3,
          'need_text' => true,
      ]
    ];
    ->addFormItem("main_business", "checkbox_text", "主营业务", "", $option)
    
    //注意:组件会自动构造好json格式的数据提交,直接存入对应的数据库字段即可
  • ColumnType

    考虑展示内容可能会比较多,放listbuilder进行编辑并不优雅,暂时不支持editable模式

      $option = [
          [
              'title' => '网站开发',
              'key' => 1,
          ],
          [
              'title' => '公众号运维',
              'key' => 2,
          ],
          [
              'title' => '其他',
              'key' => 3,
              'need_text' => true,
          ]
      ];
    ->addTableColumn("main_business", "主营业务", "checkbox_text", $option)

前端单独使用checkbox-text.js

用法参照asset/demo.html

name属性会自动赋予input hidden组件,用于form提交数据时用

option是组件展示配置,格式是json字符串,具体设置参照上面的$option说明

value是组件的默认值,格式是json字符串,参照builder存入数据库的格式,一般直接配置后端读取即可

class如果没有特殊的样式要求,可以使用qscmf-checkbox-text,否则可以自定义一个别的类名,但是需要自己写样式

qscmf-builderitem-checkbox-text's People

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.