Riot 4.6.0 发布,JavaScript 的 MVP 框架

栏目: 软件资讯 · 发布时间: 5年前

内容简介:Riot 4.6.0 发布了,更新内容如下: 修复了在<template>标签中呈现文本表达式的情况下的小写问题 更新改进了核心代码、编译器和 dom 绑定 通过<slot>属性添加对 HOC(高阶组件)组件的支持,例如: Provider <...

Riot 4.6.0 发布了,更新内容如下:

  • 修复了在<template>标签中呈现文本表达式的情况下的小写问题
  • 更新改进了核心代码、编译器和 dom 绑定
  • 通过<slot>属性添加对 HOC(高阶组件)组件的支持,例如:

Provider

<hoc-component>
  <slot message={ message } theme={ theme }/>
  
  <script>
    export default { 
      message: 'hello', 
      theme: 'dark' 
    }
  </script>
</hoc-component>

Consumer

<app>
  <hoc-component>
    <!-- the {message} property will be provided by the <hoc-component> -->
    <h1>{ message }</h1>

    <!-- the {theme} property will be provided by the <hoc-component> -->
    <sidebar theme={ theme }/>
  </hoc-component>

  <!-- the {message} property is not available outside of the <hoc-component> -->
  <p>{ message }</p>
</app>

Riot 是一个简单而优雅的基于组件的 UI 库,为所有现代浏览器带来了自定义组件。其支持浏览器包括:

Riot 4.6.0 发布,JavaScript 的 MVP 框架

它的体积也很小,只有 6k:

Riot 4.6.0 发布,JavaScript 的 MVP 框架


以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

How to Build a Billion Dollar App

How to Build a Billion Dollar App

George Berkowski / Little, Brown Book Group / 2015-4-1 / USD 24.95

Apps have changed the way we communicate, shop, play, interact and travel and their phenomenal popularity has presented possibly the biggest business opportunity in history. In How to Build a Billi......一起来看看 《How to Build a Billion Dollar App》 这本书的介绍吧!

在线进制转换器
在线进制转换器

各进制数互转换器

随机密码生成器
随机密码生成器

多种字符组合密码

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具