Coder Social home page Coder Social logo

yox's People

Contributors

musicode avatar yujiangshui 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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

yox's Issues

技术文档错别字?

image
指令》事件节流 章节里面,‘直觉’还是‘自觉’?

不知道疑似错别字能不能提issue :)

dblclick

为啥我绑定on-dblclick双击事件,单击的时候也触发呢?该如何阻止单击事件

English Documentation

This seems like a great alternative to Vue.

As a suggestion, it would be great if the documentation would be available in English.

on-click问题

<li class="car pull_left in_border relative_pos" on-click="carCheck($event,computedDatas[index])" style="height: 133px;padding-right: 0;"> <i class="iconfont absolute_pos car_check"><span hidden>{{id}}</span></i> <div style="height:100%"> <p> <span style="width: 60px;display: inline-block;text-align: right">状态:</span> {{#if status==1}} <span>启用</span>{{/if}} {{#if status==0}}<span >禁用</span>{{/if}} </p>
我给li绑定了on-click事件,可是他会穿透到下面的i ,p等元素,如何阻止呢,因为我想只点击li的时候才执行

【调查】正在使用 Yox 的用户请进

如果你正在使用 Yox,并且计划一直使用下去,请在此回复,格式如下:

  • Yox 版本:复制 Yox.version 字符串
  • 是否为公司项目:是|否
  • 是否会升级到最新版本:是|否
  • 选择 Yox 的原因:简单说明一下咯

主要想了解有多少人真实在用 Yox,如果用的人多,以后的升级会重点考虑兼容性,如果使用的人少,则考虑最优设计。

这里监听的index 返回undefined

{
watchers: {
'users.*.name': function (newValue, oldValue, keypath, index) {
console.log('第' + index + '个用户的名称变化了');
}
}
}

ie8下,当页面使用了button,yox.js(886,15)会报错“对象不支持此操作”

报错的是以下这段代码中的:object[key] = value;。
/**

  • 为对象设置一个键值对
  • @param object
  • @param keypath
  • @param value
  • @param autofill 是否自动填充不存在的对象,默认自动填充
    */
    function set(object, keypath, value, autofill) {
    each$1(keypath, function (key, index, lastIndex) {
    if (index === lastIndex) {
    object[key] = value;
    }
    else if (object[key]) {
    object = object[key];
    }
    else if (autofill) {
    object = object[key] = {};
    }
    else {
    return FALSE;
    }
    });
    }

开源项目问题?

最近在看楼主开源的项目源码,在看到很早楼主开源过gui框架,对里面架构觉得比较新奇,请教下,楼主开发的灵感来自于哪,或者说那些库,谢谢解答

ie8下的textarea问题

<textarea name="remarksName" id="" rows="5" maxlength="200" class="form-control" placeholder="请输入内容" model="searchForm.remarks"></textarea> <div class="textarea-number"> {{searchForm.remarks}} </div>
ie8下,当textarea双向绑定了数据,输入内容后,下面div的数据没有跟着改变,同时出现了报错信息:yox.js (5716,19)对象不支持此属性或方法
报错的地方是下面的node[innerText] = text;
function text(node, text, isStyle, isOption) { if (text !== UNDEFINED) { { if (isStyle && has$2(node, STYLE_SHEET)) { node[STYLE_SHEET].cssText = text; } else { if (isOption) { node.value = text; } node[innerText] = text; } } } else { return node[innerText]; } }

removeAt(keypath, index),删除报错

https://jsfiddle.net/3jx6x8e1/17/

上面的数据是我我请求接口的数据结构简写,此处初始静态数据,数组删除没问题
但如果ajax回调res
his.set("structureItems", res.normalGoods.structureItems)
这样删除,控制台就会报错如下:
vendor.js:6366 Uncaught TypeError: Cannot read property 'off' of undefined
at Yox.off (vendor.js:6366)
at unbind (vendor.js:5847)
at vendor.js:5859
at vendor.js:1509
at vendor.js:788
at each (vendor.js:384)
at each$1 (vendor.js:787)
at Object.destroyDirectives (vendor.js:1508)
at execute (vendor.js:228)
at Emitter.fire (vendor.js:992)
at Yox.off (vendor.js:6366)
at unbind (vendor.js:5847)
at vendor.js:5859
at vendor.js:1509
at vendor.js:788
at each (vendor.js:384)
at each$1 (vendor.js:787)
at Object.destroyDirectives (vendor.js:1508)
at execute (vendor.js:228)
at Emitter.fire (vendor.js:992)

Issue with babel-preset-env

Hey @musicode, I tracked you problem with the babel-preset-env.

I cloned your repository and tried to run it locally. Although the rollup was configured correctly, you were right, that it still throw a module transformer error. Problem is not in rollup and it's config. Problem lies in the packages you are using internally. Namely yox-common, yox-expression-compiler, yox-observer and yox-template-compiler, they all specify it's custom .babelrc file with babel-preset-es2015, which causes ES6 module transformation, when I deleted all the .babelrc files, I was able to build the library successfully.

Although I don't really understand the reason behind specifying .babelrc in each package, but as a solution a propose specifying a module field in each package.json pointing to a root file, since your packages are already written using ES6 modules. You can read more about it here - https://medium.com/webpack/webpack-and-rollup-the-same-but-different-a41ad427058c

Hopefully it helps.

我又遇到一个问题 深度数组 第2层有更改了之后 dom层没有反应

`


<script id="template" type="plain/text">

{{#each it:i}}

{{GysName}}

{{#each listcg:ii}}
{{GID}}---{{Num}}-+ {{/each}}

{{/each}}

</script>

<script src="../dist/yox-legacy.min.js"></script>
<script>
    var instance = new Yox({
        el: '#app',
        template: '#template',
        data: {
            it: [{
                "GysName": "A",
                "Cbks": false,
                "listcg": [{
                    "Num": 1,
                    "Multiple": 24,
                    "GID": 6800,
                    "Cbk": false
                }, {
                    "Num": 10,
                    "Multiple": 10,
                    "GID": 9857,
                    "Cbk": true
                }, {
                    "Num": 10,
                    "Multiple": 10,
                    "GID": 10013,
                    "Cbk": true
                }]
            }, {
                "GysName": "B",
                "Cbks": false,
                "listcg": [{
                    "Num": 1,
                    "Multiple": 24,
                    "GID": 17739,
                    "Cbk": false
                }]
            }]
        },
        methods: {
            add: function(keypath) {
                console.log(keypath);
                var tt = this.get(keypath);
                tt.Num = parseInt((tt.Num + tt.Multiple) / tt.Multiple) * tt.Multiple;
                this.set(keypath, tt);
                console.log(JSON.stringify(this.get('it')));
            },
            sub: function(keypath) {
                console.log(keypath);

            }
        }
    });

    // console.log(1)
</script>`

赞一个!有QQ群吗?

跟vuejs一样比较容易入门,兼容IE6-8还是很有必要的,有QQ群或是别的方式交流吗?有些问题想请教

像这样我怎么区分cbk

new Yox({ el: '#app', template: '#template', data: { todos: [{ "GysName": "A", "Cbk": false, "listcg": [ { "GID": 1, "Cbk": false }, { "GID": 2, "Cbk": true }, { "GID": 3, "Cbk": true } ] }, { "GysName": "B", "Cbk": false, "listcg": [{ "GID": 4, "Cbk": false }] } ] } });
`

<script id="template" type="plain/text">
    {{#each todos:i}}
  • {{#each listcg:ii}}
    {{GysName}}-{{i}}{{Cbk}}---{{GID}}-{{Cbk}}
    {{/each}}
  • {{/each}}
</script> <script src="https://unpkg.com/yox"></script>

`

文档给出的代码无法运行

在文档中的案例是无法运行的,这很打击刚接触的人。
直接复制一下代码运行报错:

<script id="template" type="text/plain">
name: {{name}}
version: {{version}}
</script>`

image
报错信息:yox.esm.js:1038 Uncaught Error: [Yox fatal]: The "template" option should have just one root element.

YOXJS能否像vue那样,只需要在dom中指定作用域,而不需要写template模板,也能使用

为了兼容ie8,比较了各种框架,最后看到了yoxjs,感觉跟vue神似。但是有一点感觉不如vue方便,在vue中,指定了el作用域后,是不需要指定template的,而yoxjs中,所有被yox作用域覆盖的代码必须写template里。这里就有一个问题,每个template对应一个target挂载点。我一个页面里可能有多个template,怎么分别指定挂载点?

作者是否有计划改成和vue一样,el=“#app” 包含的所有代码片段能自动被yox解析?

毕竟把所有的html代码片段写在script标签包含的template里,一来对编辑器不友好,二来真的让人肉疼

关于keypath

有没有考虑这种奇葩数据
{
“a.b”:1,
a:{b:2}
}
如果你要把你的框架放出来给大家用的话,这种有坑的情况应该是要解决的,毕竟人家的数据是符合规范的。
单元测试不可少,不然不敢用呐。

Object.freeze的那啥...

Object.freeze大佬 我看你代码里用到了这个属性,怎么没看到兼容性的处理哦

加油作者,问一个关于依赖路径的问题

我读了一点点的源码。发现了一个地方

import {
  Watcher,
} from '../../../yox-type/src/type'

引用路径为什么要这样写?
我可以默认开发的时候需要把对应所有的yox-开头的库按照这种结构整理一下嘛?
或者说作者有什么别的考虑是我没想到的

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.