syst
mini mvc framework
Last updated 4 years ago by rodey .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install syst 
SYNC missed versions from official npm registry.

SYST

SYST JS 是一个js MVC框架 功能比较纯粹简单, 使用起来也比较简单,里面有案例

  • 此框架依赖于: jQuery || Zepto
  • 使用前请先引入依赖插件
  • requireJS 引入:
		'SYST' : {
			deps : ['Zepto'],
			exports: 'SYST'
		}
 

Model(模型创建);

 defaine([], function(){
    var model = SYST.Model({
        name: 'model----',
        init: function(){ // 初始化,如果没有可以不写 }

    });
    return model;
 });

Controller(控制器)

 defaine(['model'], function(model){

    var controller = SYST.Controller({
        name: 'controller----;
        model: model,
        parseData: function(){
          // 格式化从后台请求的数据
        }
    });

    return controller;
 });

View(视图)

  defaine(['controller'], function(controller){

    var view = SYST.View({
        name: 'view----;
        controller: controller,
        model: controller.getModel(),
        events: {
          'click document': 'domClick'
        },

        init: function(){ //初始化页面 },

        domClick: function(evt){
          var self = this;
          console.log(self);
          console.log(evt);
          alert('document click!!!');
        }
    });

    return view;
 });

index.html;

	<!DOCTYPE html>
	<html>
	<head>
	  <meta charset="UTF-8" />
	  <title>SYST JS FRAMEWORK</title>
	</head>
	<body


	  <script src="js/libs/require/require.js"
			  data-main="js/libs/mian.js"
			  data-app="js/index/init.js"
			  data-appname="index"></script>
	</body>
	</html>

Current Tags

  • 2.0.4                                ...           latest (4 years ago)

1 Versions

  • 2.0.4                                ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (14)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |