Skip to content

avlcjw/w-framework

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Welcome to W-framework - A Frontend Framework base on jQuery ^1.12.0 & compatible with ^IE8

一款基于 `jQuery^1.12.0` 兼容 `IE8` 的前端框架

You can fork on GitHub to maintain the content of the framework.

您可以在GitHub上分支框架来维护内容。

Diagram [框架图表]

Diagram

link: Diagram

startup [启动并返回实例]

//return an Instance. Used to manipulate datas with the servals APIs;
var w = new W({
    model: {
      datas: {
        atestData: '这是测试初始化数据',
        username: '用户名',
        password: '123123123123ss',
        items: [
          {
            name: 'name1',
          },
          {
            name: 'name2',
          }
        ]
      }
    },
    view: {
      container: '#container',
      events: {
        init: function (e) {         
          // console.log(this, '程序初始化回调函数!');
        },
        buy: function (e) {
          // console.log(this);
        },
        test: function (e) {
          // console.log(this);
          alert('test');
        }
      }
    }
  });
  
   w.$datas.password = 321;
   //this operation with change the Instance, and the framework will automatic update the view inside the app.
  

Template & Directive [模版指令]

  • lva-bind:显示数据
  • lva-each:循环数据
  • lva-if:条件显隐
<div class="row">
    <div class="col-sm-12">
      <h4>1.循环指令: lva-each</h4>
      <ul class="swiper-wrapper">
        <li lva-each="items">
          <span lva-bind="name"></span>
        </li>
      </ul>
    </div>
    <div class="col-sm-12">
      <h4>2.绑定指令: lva-bind</h4>
      <p lva-bind="atestData3"></p>
    </div>
</div>

DataFlow [数据绑定]

  • lva-model:绑定数据
<div class="form-group">
        <label for="username">
          双向绑定:username -
          <span lva-bind="username"></span>
        </label>
        <input type="text" class="form-control" id="username" placeholder="请输入username" lva-model="username">
</div>

Support or Contact

Having trouble with Pages? Check out our documentation or contact support and we’ll help you sort it out.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published