Git Product home page Git Product logo

j-component's People

Contributors

2hu12 avatar genuifx avatar juneandgreen avatar tidyzq avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

j-component's Issues

`create` 方法如何渲染默认 slot?

如题,例如我需要测试一个类 button 组件,我需要渲染其文字内容,形如:

create(button, {
  children: 'Button Text'
})

现在的 create 方法(以及 miniprogram-simulaterender 方法)似乎并不支持

[FEAT] Support default behaviors

目前的 j-component 不支持小程序内置的behavior wx://form-fieldwx://component-export ,导致 simulate 也不支持相关特性。

这里是否可以通过替换默认的behavior来支持该特性?

有测试page的方法吗

请问有测试页面逻辑的方法吗? 这个库可以用作component的测试已经很赞了,可是我还想要一个测试page的方法,请问有吗?

bug: component.setdata方法的实现与小程序的component.setdata行为不一致

github地址:https://github.com/hopperhuang/miniprogram-reactive
这是我自己写的一个用于小程序的computed和watch,类似于vue的实现,通过监听this.data属性的getter和setter来实现的。
单元测试,initcomponent是报错的,component.setdata的时候,并没有触发this.data的setter,所以computed和watch并没有触发。
我的代码在小程序的开发工具上跑是没有问题的,具体的例子在examples/miniprogram里面,可以跑起来看看效果

generate virtualnode 时希望给for语句添加一个默认空数组

背景

在使用小程序运行时增强框架时,框架会提供computed watch等语法,这些语法糖是在组件attached生命周期注入相应的mixin实现,在第一次jComponent.create执行时,相应的data对象中并不存在wx:for所取数据,会在执行list.length时报错,所以希望这里加一个默认空数组的兜底逻辑。

具体改动

我尝试给项目提pr,但并无项目权限,具体改动在 src/template/virtualnode.js 207行

        const list = expr.calcExpression(statement.for, data) 
        // 修改为
        const list = expr.calcExpression(statement.for, data) || []

辛苦review支持

关于自定义组件实现的疑问

hi 你好,我有个疑问,希望你帮帮我看看。
关于自定义组件,因为组件系统是在渲染层实现,但是原则上用户的逻辑代码在逻辑层执行,我比较疑惑的是自定义组件是如何实现的,即自定义组件在哪一层实例化,如何通信?

selectorquery 中对于node属性获取添加非空判断

问题描述

selectorquery exec 中获取到的node可能为null,对于node属性取值时有可能会报错

具体改动

具体改动在 j-component/src/tool/selectquery.js 119行

        for (const node of nodes) {
            const itemRes = {}
        // 修改为
        for (const node of nodes) {
            if (!node) continue
            const itemRes = {}

辛苦review支持

Feature: 外链wxs的支持

目前我的做法是正则匹配到带有src的wxs标签,用读取到外链文件内容后,replace掉原来的wxs标签内容:

替换前:

<wxs src="../../common/wxs/array.wxs" module="utils" />
<view>{{utils.xxx}}</view>

替换后:

<wxs module="utils" />
// 这里是common/wxs/array.wxs文件内容
</wxs>
<view>{{utils.xxx}}</view>

这样做效率挺低的,基本上每个文件都是外链wxs,都需要替换一下,作者有更好的思路吗?

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.