javey / intact Goto Github PK
View Code? Open in Web Editor NEWAn inheritable and strong logic template front-end mvvm framework.
Home Page: https://javey.github.io/Intact
An inheritable and strong logic template front-end mvvm framework.
Home Page: https://javey.github.io/Intact
When a Animate
is leaving to hide, and then we disable its animation and show it, it can not be handled correctly.
如果组件可以返回多个节点,如何兼容Vue/React
函数式组件如果返回多个节点,如何兼容Vue/React
For children of component, misstime should normalize them. So we can iterate them like a flattened array. But should not add key for them. The key should be added in html element. Otherwise the keys may be conflicted.
<Component>{[<div></div>, 1]} 2</Component>
=> flatten
<Component><div></div>1 2</Component>
When enter a leaving element. misstime
will append it, this operation will lead to the last leaving animation breaks. If we don't append the dom, then how to keep the order of the dom correctly?
Because of isRender
has changed when the component is updating rather than rendering first time.
<Animate v-if={self.get('show')}></Animate>
this.on('$change:show', () => { this.update(); });
this.set('show', true);
class Component extends Intact {
_init() {
this.on('event', () => {
console.log('this should be called later');
});
}
}
<Component ev-event={() => console.log('this should be called firstly')} />
The set
method should support set object
type value by path like bellow:
this.set({'a.b': 1, 'a.c': '2'}, {path: true});
// trigger $change:a.b $change:a.c $change:a $change $changed:a.b $changed:a.c $changed:a $changed
this.get('a') // {b: 1, c: '2'}
Support validate and correct property like bellow:
class A extends Intact {
static propTypes = {
show: Boolean,
name: {
type: Number,
fix: (value) => {
return Number(value);
}
}
}
instance.set('["a.a"]', 1) // {'a.a': 1}
instance.get('["a.a"]') // 1
When a element is entering. It will be added enter
className, then we call getAnimateType
method will add enter-active
className. In this case the animation has been triggered in firefox. So we should call getAnimateType
method before adding enter
className.
Such as
// AnotherComponent
<div>{self.get('children)}</div>
// Component
<div>
<AnotherComponent>
<b:body>test</b:body>
</AnotherComponent>
</div>
<Component>
<b:body>component</b:body>
</Component>
if AnotherComponent
have not a block named body
, the content wich passd as block in Component
will be ignored. Because the body
block is a blocks
property for AnotherComponent
, not children
.
Howerver you can do like this:
<div>
<AnotherComponent>
<div>
<b:body>test</b:body>
</div>
</AnotherComponent>
</div>
Because v-model
has been compiled to ev-$change:value
property, we can't add ev-$change:value
property again. But we do need this feature. Maybe we can compile them to Array
when add both of them.
Let user to handle compatibility of IE.
Update an Animate
component when it's rendering, the isRender
flag will be set to false
. This make the component trigger enter
animation when mount it. But it is rendering in fact.
We should set isRender
to false in this case.
As shown in title
_init
: can't get vNode and operate vNode;
_create
: can operate vNode but it is too late and must make component to update
Add a _beforeCreate
lifecycle method between _init
and _create
to operate vNode before render.
Let two way bind support any property like bellow:
<Component v-model="value" v-model:name="name" v-model:data.age="age" />
When invoke update method in updating, the $changed
events will be discarded.
this.on('$changed:value', () => {
// this callback does not be called
});
this.on('$change:value', () => {
this.update()
});
this.set('value', 1);
Change placeholder or foucsin/foucsout to make it change will trigger input event.
When we pass a Object
to child component, the child component may change the property of that Object
. But the $change
event can not to be triggered.
class A extends Intact {
defauts() {
return {data: {}};
},
change() {
// this set will trigger '$change:data.a' and '$change:data' events
this.set('data.a', 1);
}
}
// when the users has changed by `change` method of A component
// we can not get the `$change:user.a` and `$change:user` events
<A data={self.get('user')} />
So we should freeze the property which passed to child component.
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.