Giter Site home page Giter Site logo

shopping-cart-tpl's Introduction

购物车统一模板

依赖artTemplate jquery

##使用方法

new ShoppingCart(element,config)
// element jQuery 选择器 表示 购物车 父容器
// config
 // 两个参数 tpl  表示 模板的选择器
             datasource 数据源
            

模板中提供的变量

  • count 总计价格

  • select 当前选择的数量

  • data 商品数据列表

  • data-event 表示要监听的事件

    • em 表示 减少一个数量
    • ps 增加一个数量
    • change 输入改变
    • check 选择
    • ck-all 表示全选 / 全不选
    • del 删除

实现原理

基于artTemplate callbacks 事件回调函数完成 观察者

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.