Skip to content

Commit

Permalink
fix(core): fix form sandbox (#1670)
Browse files Browse the repository at this point in the history
  • Loading branch information
Justineo authored Sep 27, 2024
1 parent d99987a commit df88a43
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
9 changes: 8 additions & 1 deletion packages/core/forms/sandbox/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,19 @@
</template>

<script setup lang="ts">
import { ref } from 'vue'
import { ref, provide } from 'vue'
import FieldTester from './FieldTester.vue'
import { FORMS_API_KEY, VueFormGenerator } from '../src'
// dummy data
import schema from './schema.json'
import model from './model.json'
provide(FORMS_API_KEY, {
getOne: async () => ({}),
getAll: async () => [{}],
})
const mutableModel = ref(model)
const fieldSchema = {
Expand Down
8 changes: 2 additions & 6 deletions packages/core/forms/sandbox/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { createApp, provide } from 'vue'
import { createApp } from 'vue'
import App from './App.vue'
import Kongponents from '@kong/kongponents'
import '@kong/kongponents/dist/style.css'
import { FORMS_API_KEY, VueFormGenerator } from '../src'
import { VueFormGenerator } from '../src'

const app = createApp(App)

Expand All @@ -11,9 +11,5 @@ app.use(Kongponents)
// For correct rendering, host app should make the component available
// globally and provide the API endpoints for autosuggest
app.component('VueFormGenerator', VueFormGenerator)
provide(FORMS_API_KEY, {
getOne: async () => ({}),
getAll: async () => [{}],
})

app.mount('#app')

0 comments on commit df88a43

Please sign in to comment.