Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Just want to change btn-sm to btn-xs like demo #1012

Open
jonny77 opened this issue Dec 12, 2024 · 0 comments
Open

Just want to change btn-sm to btn-xs like demo #1012

jonny77 opened this issue Dec 12, 2024 · 0 comments

Comments

@jonny77
Copy link

jonny77 commented Dec 12, 2024

<template>
  <div id="builder"></div>
</template>

<script>
import { onMounted } from 'vue';
import $ from 'jquery';
import 'jQuery-QueryBuilder/dist/js/query-builder.js'
import 'jQuery-QueryBuilder/dist/css/query-builder.default.css'
export default {
  name: 'QueryBuilder',
  setup() {
    onMounted(() => {
      $('#builder').queryBuilder({
        template: {
          group: function(data) {
            const template = doT.template(`
        <div id="{{=it.group_id}}" class="rules-group-container">
          <div class="rules-group-header">
            <div class="btn-group pull-right group-actions">
              {{? it.condition_readonly === false }}
                <button type="button" class="btn btn-xs btn-success" data-add="rule"><i class="glyphicon glyphicon-plus"></i> Rule</button>
                <button type="button" class="btn btn-xs btn-success" data-add="group"><i class="glyphicon glyphicon-plus-sign"></i> Group</button>
              {{?}}
              {{? it.deletable }}
                <button type="button" class="btn btn-xs btn-danger" data-delete="group"><i class="glyphicon glyphicon-remove"></i></button>
              {{?}}
            </div>
            {{~ it.conditions :condition }}
              <label class="btn btn-xs btn-primary {{? condition.checked }}active{{?}}" data-toggle="condition" data-value="{{=condition.value}}">{{=condition.label}}</label>
            {{~}}
          </div>
          <div class="rules-group-body">
            <div class="rules-list"></div>
          </div>
        </div>
      `);
            return template(data);
          }
        }
        ,
        filters: [
          {
            id: 'name',
            label: 'Name',
            type: 'string',
          },
          {
            id: 'age',
            label: 'Age',
            type: 'integer',
            validation: {
              min: 0,
              max: 100,
            },
          },
          {
            id: 'gender',
            label: 'Gender',
            type: 'string',
            input: 'select',
            values: {
              male: 'Male',
              female: 'Female',
            },
          },
        ],
      });
    });
  },
};
</script>

here is my screenshot :
image

i used npm install , and run in vue3, tried to use string template and doT.js ,both not working
not working

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant