8000 Merge branch 'master' of github.com:vue-use-form/vue-use-form · vue-use-form/vue-use-form@9e2fcd2 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9e2fcd2

Browse files
committed
Merge branch 'master' of github.com:vue-use-form/vue-use-form
2 parents e904a98 + d143492 commit 9e2fcd2

File tree

5 files changed

+21
-17
lines changed

5 files changed

+21
-17
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
22
"name": "main",
3-
"version": "0.0.0",
3+
"version": "0.1.0",
44
"description": "Some composables form validator for vue",
55
"license": "MIT",
66
"author": "Snowingfox",
77
"main": "index.js",
88
"scripts": {
99
"lint": "eslint --cache .",
1010
"core:build": "cd packages/core && npm run build",
11-
"play:build": "cd playground && npm run build",
11+
"play:build": "pnpm i && npm run core:build && cd playground && npm run build",
1212
"play:dev": "npm run core:build && cd playground && npm run dev"
1313
},
1414
"peerDependencies": {

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-use-form",
3-
"version": "0.0.1",
3+
"version": "0.1.0",
44
"description": "",
55
"keywords": [
66
"vue",

playground/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
{
22
"name": "@vue-use-form/playground",
3-
"version": "0.0.1",
3+
"version": "0.1.0",
44
"private": true,
55
"scripts": {
66
"dev": "vite",
77
"build": "vite build",
88
"serve": "vite preview"
99
},
10-
"devDependencies": {
11-
"@vitejs/plugin-vue": "^1.10.2",
12-
"vite": "2.9.14"
13-
},
1410
"dependencies": {
1511
"@vue/repl": "^1.3.0",
1612
"file-saver": "^2.0.5",
1713
"jszip": "^3.6.0",
1814
"vue": "3.2.38"
15+
},
16+
"devDependencies": {
17+
"@vitejs/plugin-vue": "^1.10.2",
18+
"vite": "2.9.14"
1919
}
2020
}

playground/src/App.vue

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@ if (hash.startsWith('__SSR__')) {
2323
useSSRMode.value = true
2424
}
2525
26+
const serializedState = location.hash.slice(1)
27+
2628
const store = new ReplStore({
27-
serializedState: hash,
29+
serializedState,
2830
defaultVueRuntimeURL: import.meta.env.PROD
2931
? `${location.origin}/vue.runtime.esm-browser.js`
3032
: `${location.origin}/src/vue-dev-proxy`,
@@ -36,15 +38,17 @@ const store = new ReplStore({
3638
store.setImportMap({
3739
imports: {
3840
'vue-use-form': import.meta.env.PROD
39-
? `${location.origin}/vue-use-form.js`
40-
: `${location.origin}/src/vue-use-form-dev-proxy`,
41+
? `${location.origin}/vue-use-form.js`
42+
: `${location.origin}/src/vue-use-form-dev-proxy`,
4143
},
4244
})
4345
44-
store.setFiles({
45-
'import-map.json': store.getFiles()['import-map.json'],
46-
'App.vue': AppCode,
47-
})
46+
if (!serializedState) {
47+
store.setFiles({
48+
'import-map.json': store.getFiles()['import-map.json'],
49+
'App.vue': AppCode,
50+
})
51+
}
4852
4953
// enable experimental features
5054
const sfcOptions = {

playground/src/code.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export const AppCode = `<script setup>
2-
import {createErrorHandler, createSubmitHandler, useForm } from 'vue-use-form'
2+
import { createErrorHandler, createSubmitHandler, useForm } from 'vue-use-form'
33
44
const {
55
register,
@@ -16,7 +16,7 @@ const onSubmit = createSubmitHandler((data) => {
1616
1717
const onError = createErrorHandler((errors) => {
1818
alert('submit failed')
19-
} )
19+
})
2020
</script>
2121
<template>
2222
{{ errors }}

0 commit comments

Comments
 (0)
0