lljj-x / vue-json-schema-form

基于Vue/Vue3,Json Schema 和 ElementUi/antd/iview3/naiveUi 等生成 HTML Form 表单,用于活动编辑器、h5编辑器、cms等数据配置;支持可视化生成表单Schema 。 Generate a form using Vue/Vue3, Json Schema and ElementUi/antdv/iview3/naiveUi
https://form.lljj.me/
Apache License 2.0
2.06k stars 420 forks source link

Hide one footer button #278

Closed BossHogg97 closed 1 year ago

BossHogg97 commented 1 year ago

Hi, i'm working on vue3 and NaiveUI. I'm trying to hide one of two footer buttons. I have the following .ts file with form configuration.

const vueJSONFormSettings = {
// Here other form configuration
.....

// This is the form footer configuration where i want to hide the button
  newProdlineFooter: {
    show: true,
    okBtn: 'Apply Filter',
    cancelBtn: '', // This is the button that i'd like to hide
    cancelBtnProps: { hidden: true },
  },
}
export default vueJSONFormSettings 

Following the form definition

<script>
......

const formFooter = magicFormSettings.newProdlineFooter

......
</script>
<template>
      <VueForm
            v-model="productionLineData"
            :schema="schemaBoardProperties"
            :ui-schema="schemaBoardUI"
            :form-footer="formFooter"
            :form-props="formBoardSettings"
            @submit="doSaveProductionLine"
            @form-mounted="doFormMounted"
          />
</template>

Is it possible to hide it? Thanks

lljj-x commented 1 year ago

Use default slot ref: https://vue-json-schema-form.lljj.me/zh/guide/basic-config.html#%E6%8F%92%E6%A7%BD-scope-slot

BossHogg97 commented 1 year ago

Thanks