xinnian999 / vue-form-craft

基于vue3的一款开箱即用表单方案
283 stars 21 forks source link

按照官网安装方式 跑不起来 全是 error #11

Closed JaguarJack closed 8 months ago

JaguarJack commented 8 months ago
<template>
<div>
      <SchemaForm :schema="schema" footer @onFinish="onFinish" />
</div>
</template>

<script lang="ts" setup>
const schema = {
  labelWidth: 150,
  labelAlign: 'right',
  size: 'default',
  items: [
    {
      label: '分类',
      component: 'Radio',
      props: {
        mode: 'static',
        options: [
          {
            name: '前端',
            id: 1
          },
          {
            name: '后端',
            id: 2
          },
          {
            name: '运维',
            id: 3
          },
          {
            name: '其他',
            id: 4
          }
        ],
        labelKey: 'name',
        valueKey: 'name',
        optionType: 'button',
        space: 0
      },
      name: 'category',
      required: true,
      designKey: 'design-9djJ'
    },
    {
      label: '文章',
      component: 'Radio',
      props: {
        mode: 'remote',
        placeholder: '请选择文章',
        labelKey: 'title',
        valueKey: 'id',
        api: {
          url: '/current/query/article',
          method: 'GET',
          params: {
            filters: {
              category: '{{$values.category}}'
            }
          },
          dataPath: 'data'
        },
        optionType: 'circle',
        autoSelectedFirst: true,
        direction: 'vertical',
        space: 0
      },
      name: 'article',
      required: true,
      hidden: '{{!$values.category}}',
      designKey: 'design-gr3L'
    }
  ]
}

const onFinish = (values: any) => {
  alert(JSON.stringify(values))
}

image

xinnian999 commented 8 months ago

最新版本v3.0.10已经解决这个bug了,你看看你的是不是最新

JaguarJack commented 8 months ago

最新版本v3.0.10已经解决这个bug了,你看看你的是不是最新

最新的,才安装的