项目作者: sveltegaruda

项目描述 :
Svelte starter template with HMR, code splitting, datatable & modular ui-kit
高级语言: JavaScript
项目地址: git://github.com/sveltegaruda/template.git
创建时间: 2020-10-27T09:55:10Z
项目社区:https://github.com/sveltegaruda/template

开源协议:

下载


Svelte Garuda

Svelte starter template with HMR, code splitting, datatable & modular ui-kit

All Contributors
GitHub last commit
GitHub repo size in bytes
License
npm version

Instalation

  1. npx degit sveltegaruda/template my-project
  2. cd my-project
  3. npm i

Folder structure

Description Folder
File Svelte src/pages
Static files public
Output hasil

Feature

Code splitting

Execute command below

  1. npm run build

File based routed

Using Routify.

Hot module reload

The state is not reset when we develop the application. Just run:

  1. npm run dev

Bootstrap

Bootstrap ready.

SEO

Content of public/index.html:

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset='utf-8'>
  5. <meta name='viewport' content='width=device-width,initial-scale=1'>
  6. <title></title>
  7. <meta name="description" content="">
  8. <meta property="og:image" content="favicon.png">
  9. <!--/ Vooler template Start /-->
  10. <link rel="stylesheet" href="/assets/css/bootstrap.css">
  11. <link rel="stylesheet" href="/assets/vendors/perfect-scrollbar/perfect-scrollbar.css">
  12. <link rel="stylesheet" href="/datatable.css">
  13. <link rel="stylesheet" href="/assets/css/app.css">
  14. <script src="/assets/js/feather-icons/feather.min.js"></script>
  15. <script src="/assets/vendors/perfect-scrollbar/perfect-scrollbar.min.js"></script>
  16. <script src="/assets/js/app.js"></script>
  17. <script src="/assets/vendors/simple-datatables/simple-datatables.js"></script>
  18. <!--/ Vooler template End /-->
  19. <link rel='icon' type='image/png' href='/favicon.png'>
  20. <!-- <link rel='stylesheet' href='bootstrap.min.css'> -->
  21. <link rel='stylesheet' href='/global.css'>
  22. <link rel='stylesheet' href='/build/bundle.css'>
  23. <script defer src='/main.js' type="module" ></script>
  24. </head>
  25. <body>
  26. </body>
  27. </html>

We just need to adjust the title tag, meta description and image.

Loader

How to use:

  1. import {isLoading} from '@/store'
  2. $isLoading = true // untuk mengaktifkan loader
  3. $isLoading = false // untuk mematikan loader

It must be placed on folder halaman.

Absolute path

Example:

  1. import {nama} from '@/data/nama'

However, it can also be a relative path like:

  1. import {nama} from '../../../nama'

Datetime

Get the latest date with format such as 2020-08-17 00:19:45

Example:

  1. <script>
  2. import {tanggal} from '@/tanggal'
  3. </script>
  4. <p>{tanggal()}</p>

Datatable

  1. // file: src/pages/danang/index.svelte
  2. <script>
  3. import json from "./data.json";
  4. import Datatable from "@/themes/voler/datatable.svelte";
  5. import { dt } from "@/tools/store";
  6. let data = {
  7. title: "Customer",
  8. header: ["#", "Name", "Position", "Company"],
  9. json: json,
  10. };
  11. $dt = data;
  12. </script>
  13. .
  14. .
  15. .
  16. <section class="section mt-5">
  17. <Datatable ></Datatable>
  18. </section>
  1. // file: src/pages/danang/data.json.js
  2. const data = [[
  3. "Hedwig F. Nguyen",
  4. "Manager",
  5. "Arcu Vel Foundation"
  6. ],
  7. [
  8. "Genevieve U. Watts",
  9. "Manager",
  10. "Eget Incorporated"
  11. ]];
  12. export default data;

Demo

You can open the demo here

Contributing

  • Fork it ( https://github.com/sveltegaruda/template/fork )
  • Create your feature branch (git checkout -b my-new-feature)
  • Commit your changes (git commit -am 'Add some feature')
  • Push to the branch (git push origin my-new-feature)
  • Create a new Pull Request

Translation ?

We are open for contribution. For example, just want to translate into Japanese, then create a file README-jp.md which contains the translation of this README in Japanese.