yoxjs / yox Goto Github PK
View Code? Open in Web Editor NEWA lightweight mvvm framework
Home Page: https://yoxjs.github.io/yox/
License: MIT License
A lightweight mvvm framework
Home Page: https://yoxjs.github.io/yox/
License: MIT License
请问下 yox中可以使用juery么?或者其他http 如axios等
为啥我绑定on-dblclick双击事件,单击的时候也触发呢?该如何阻止单击事件
This seems like a great alternative to Vue.
As a suggestion, it would be great if the documentation would be available in English.
哥们,怎么兼容IE8及以下浏览器
想请问下我用一个modelmap包装的一个List list 这个${list}在yoxjs中应该怎么处理
http://doui.vip/list1.html
比如《span》{{GID}}《/span》 ie8上不显示
比如this.fire('test', 1)就无法取到1这个值
<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的时候才执行
multiple select 在chrome双向绑定都无问题,但在ie 环境下,只支持从数据到视图的单向绑定。视图中select的选项改变,并没有改变数据模型。
请核实。
如果你正在使用 Yox,并且计划一直使用下去,请在此回复,格式如下:
主要想了解有多少人真实在用 Yox,如果用的人多,以后的升级会重点考虑兼容性,如果使用的人少,则考虑最优设计。
支持IE6,对于政务行业码农来说吸引力很大呀。文档和示例再多一点就好了。
{
watchers: {
'users.*.name': function (newValue, oldValue, keypath, index) {
console.log('第' + index + '个用户的名称变化了');
}
}
}
报错的是以下这段代码中的:object[key] = value;。
/**
最近在看楼主开源的项目源码,在看到很早楼主开源过gui框架,对里面架构觉得比较新奇,请教下,楼主开发的灵感来自于哪,或者说那些库,谢谢解答
<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]; } }
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)
link: https://jsfiddle.net/3jx6x8e1/6/
我在computed属性中set了一个属性值,这时候在事件中改变这个属性无效。这点跟Vue有所差异。
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.
如题?找了很久文档都没有发现
`
<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>`
跟vuejs一样比较容易入门,兼容IE6-8还是很有必要的,有QQ群或是别的方式交流吗?有些问题想请教
template: `
<div>
模板文字
</div>
`
这种模板中的换行在现代浏览器中会正常显示,ie8中则会显示出多余的空格
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 }] } ] } });
`
`
现在只能循环数组,当只是想循环输出指定个数的元素时,就有点繁琐了
link: https://jsfiddle.net/3jx6x8e1/8/
情景:异步调用数据并赋值,渲染的内容由一个自定义组件包裹,随后报错。
对于支持多选 的select,比如:
张三 李四 王二当多选时,
发现无法实现双向绑定,ids始终只能绑定一个值,麻烦作者核实一下。
你好,监听 vue有深度监听 请问yox 怎么实现
link: https://jsfiddle.net/3jx6x8e1/7/
如题:yox对col这种不闭合元素模板编译错误
ie8报 对象不支持此属性或方法和yox未定义,我引的legacy/dev/yox.js。还需要引别的什么吗
https://jsfiddle.net/3jx6x8e1/32/
外层wrapper的下标fIndex,在内层list中初次遍历是正确的,在removeAt重新渲染视图后fIndex并没有更新
为了兼容ie8,比较了各种框架,最后看到了yoxjs,感觉跟vue神似。但是有一点感觉不如vue方便,在vue中,指定了el作用域后,是不需要指定template的,而yoxjs中,所有被yox作用域覆盖的代码必须写template里。这里就有一个问题,每个template对应一个target挂载点。我一个页面里可能有多个template,怎么分别指定挂载点?
作者是否有计划改成和vue一样,el=“#app” 包含的所有代码片段能自动被yox解析?
毕竟把所有的html代码片段写在script标签包含的template里,一来对编辑器不友好,二来真的让人肉疼
有没有考虑这种奇葩数据
{
“a.b”:1,
a:{b:2}
}
如果你要把你的框架放出来给大家用的话,这种有坑的情况应该是要解决的,毕竟人家的数据是符合规范的。
单元测试不可少,不然不敢用呐。
Object.freeze大佬 我看你代码里用到了这个属性,怎么没看到兼容性的处理哦
这个网站是挂了吗?
作者,兼容到IE6的代码放出来一下呀
在高版本的仿真模式能跑,但在虚拟机里面的xp都跑不起来,虽然没报错...
下载了yox-project-master,但是在ie浏览器上运行不起来自己水平不够改不动呀。。。希望可以出一个兼容ie8的工程搭建示例
吊打VUE。。。好了我走了
截图有点不方便,情景为我动态生成select的option,然后在model上绑定了一个value为‘’的一个属性,当初始化循环生成的option长度为0时,ie8下就报错在var selectedOption = options[selectedIndex]
这一行提示对象不支持此属性或方法
我读了一点点的源码。发现了一个地方
import {
Watcher,
} from '../../../yox-type/src/type'
引用路径为什么要这样写?
我可以默认开发的时候需要把对应所有的yox-
开头的库按照这种结构整理一下嘛?
或者说作者有什么别的考虑是我没想到的
如题
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.