1

Dative.JS Tutorial

 2 years ago
source link: https://dev.to/tobithedev/dativejs-tutorial-1ido
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Introduction

DativeJs Is A Mordern Ui Javascript FrameWork

How Do I Use Dative.Js

First

Scaffold A Project

$ npx degit dativeJs/template my-app

# Install All The Dependencies
$ npm i

Enter fullscreen mode

Exit fullscreen mode

That Command Should Create a template with Dative.JS There

File Structure Should Be Considered While Creating a New Component

my-app
|- src
   |- your-component
      |- your-component.dative.html // The Template
      |- your-component.dative.js // The Script

Enter fullscreen mode

Exit fullscreen mode

  // your-component.dative.js
  import Dative from 'dativejs';
  import template from './your-component.dative.html';

  export let YourComponent = Dative.extend({
     template,
     // Other Options Goes Here
  })

Enter fullscreen mode

Exit fullscreen mode

Then You Can Import it in the src/index.js

import { YourComponent } from './your-component/your-component.dative'

...

app.attach([
  ...,
  new YourComponent({
     el: '#your-component-id'
  })
])

Enter fullscreen mode

Exit fullscreen mode

You Set

Check DativeJS Docs for more details

Thanks For Reading :)


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK