0.1.3 • Published 8 years ago

befe-riotjs-loader v0.1.3

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

riotjs truely module loader

Installation

npm install --save-dev befe-riotjs-loader

Notice

  • Only one tag is allow on the tag.
  • riotmap is required for loading customed tags

usage

# index.js (entry file)
var riot = require('riot')
var tag = require('./my-tag.tag')

riot.mount('#root', tag, {
    name: 'world'
})

# my-tag.tag
var riotmap = {
    section: require('./section.tag')
}

<my-tag>
    <h1 ha={ name } onClick={handleClick}>hello { name }</h1>
    <div riot-tag="section"></div>

    <script>
        this.name = opts.name || 'world';

        this.handleClick = function() {
          alert('hi')
        }
    </script>
</my-tag>


# section.tag
<my-section>
    <span>My section</span>
</my-section>

Links