AngularJS的双向绑定一直为人称道,但使用AngularJS需要对页面组件化,学习成本还是很高的。

本文源自 https://github.com/gwendall/way.js 边学边译。

使用:引用一个js文件即可。

<script src="way.min.js"></script>

way.js.  官方JS脚本 点击下载

 

开始:

声明一个HTML元素和一些标记

 <form way-data="myFormData" way-persistent="true">
    <input type="text" name="name">
    <input type="text" name="age">
    <input type="text" name="gender">
  </form>

  Name: <span way-data="myFormData.name"></span>

现在每一个变化将存储内存。和绑定数据将持续,这意味着你的HTML会填充你的页面重新加载数据。

文档:

 
名称 类型 默认值 描述
data string null js的数据。
default strign null 如果没有绑定值,链接的默认数据设置一个元素.
       
       
       
       
       
       
       

 

相关文章:

  • 2021-08-17
  • 2022-01-21
  • 2022-12-23
  • 2022-12-23
  • 2021-05-07
  • 2021-11-01
猜你喜欢
  • 2022-12-23
  • 2021-08-25
  • 2021-08-28
  • 2021-06-27
  • 2021-11-04
  • 2022-12-23
  • 2021-12-20
相关资源
相似解决方案