I am new to the world of sveltejs, the front end world. I have a project using the package sveltejs-forms, and use the REPL sveltejs-form demo as the start point. For some reason, I can not use the latest version of sveltejs-forms, but I would like to customize some code for my own use, such as set the default selected option.
Here is the part of package.json of my project
"devDependencies": {
"svelte": "3.20.0",
"sveltejs-forms": "1.0.0",
"yup": "0.16.4"
}
In the REPL demo code, for the purpose of setting default selected option, I would like to change the code from
const langOptions = [
{ id: 'svelte', title: 'Svelte' },
{ id: 'react', title: 'React' },
{ id: 'angular', title: 'Angular' },
];
to
const langOptions = [
{ id: 'svelte', title: 'Svelte', default: true },
{ id: 'react', title: 'React' },
{ id: 'angular', title: 'Angular' },
];
so I've download the code sveltejs-forms 1.0.0 from github, and extracted it locally as below:
And want to change the demo code from
<script>
import { Form, Input, Select, Choice } from 'sveltejs-forms';
to
<script>
import { Form, Input, Select, Choice } from './my-local-sveltejs-forms.svelte';
How can I do?
I have google for 'modify sveltejs package locally', but nothing found. And google "how to create package for sveltejs", and read the article Creating a package for Svelte for hint (but not yet dive in), and watch the youtube How to create a web component in sveltejs, and Svelte - Make web components!
Does there have any documents for how to create the package for Svelte? Or do you experts have any suggestion? Or just go the the github repo to have an issue?