GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — purejs/README.md at master · ordinarypace/purejs

Expand file tree

/

README.md

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
86 lines (70 loc) · 1.55 KB
/

README.md

Copy path

File metadata and controls

86 lines (70 loc) · 1.55 KB
Raw
Copy raw file
Download raw file
Outline
Edit and raw actions

purejs

Not SPA, Simple Framework base ES2015+, Laravel (bundling to laravel mix)

Use

install dependencies & dev dependencies
$npm install
Router

services/router/index.js

{
    path: '/',
    component: component,
    template: template,
    children: [
        {
            path: '/:id',
            component: component,
            template: template
        }
    ]
}
Module
views/...js

const ModuleName = class {
  constructor(service, template){
        // inject service, template
        Helper.object.prop(this, { ...service });

        this._template = template;
        this._fetchData();
    }

    async _fetchData(){
        const data = await this.http.request({ method: 'get', url: '...' });
        this.render({ data });
    }

    render({ data }){
        const render = [
            {
                target: Helper.$.get('#app'),
                data: data,
                component: this._template.index
            }
        ];

        this.template.compile(render).then(({ render }) => { if(render) console.log('Completed Render')});
    }
}
Dynamic Loaded
services/router/index.js

Loader = (isMobile = Helper.isMobile()) => isMobile ? import('/mobile/sheme') : import('/pc/scheme'); 
Templates
templates/...js

JSX Style
export default {
  index({ data, index }){
    return (`<div id="app>${data.id}</div>"`);
  }
};

Create Elements
export default {
  index({ data, index }){
    return Helper.el('div', 'class', 'app', 'innerHTML', 'app')'
  }
};
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.