fix scoped style bug

This commit is contained in:
kmdjs 2016-05-15 22:01:18 +08:00
parent e290ed8b29
commit 669c67b969
5 changed files with 12 additions and 6 deletions

5
dist/nuclear.js vendored
View File

@ -1510,6 +1510,9 @@ Nuclear._mixObj = function (obj) {
}
};
obj._nuclearSetStyleData=function(){
this.node&&this.node.querySelector('style').setAttribute('data-nuclearId',this._ncInstanceId);
}
obj._nuclearRender = function (item) {
var isFirstRender = false;
@ -1550,7 +1553,7 @@ Nuclear._mixObj = function (obj) {
this._nuclearFix();
if (this.onRefresh) this.onRefresh();
}
this._nuclearSetStyleData();
//刷新局部样式
if (!isFirstRender) {
Nuclear.refreshStyle(this._ncInstanceId);

4
dist/nuclear.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -24,7 +24,7 @@
</template>
<div id="todoListContainer"></div>
<script src="http://alloyteam.github.io/Nuclear/js/nuclear.min.js"></script>
<script src="../dist/nuclear.min.js"></script>
<script>
var todoTpl = document.querySelector("#myTemplate").innerHTML;

View File

@ -1,6 +1,6 @@
{
"name": "alloynuclear",
"version": "0.2.4",
"version": "0.2.5",
"description": "made UI super easy.",
"main": "nuclear.js",
"scripts": {

View File

@ -141,6 +141,9 @@ Nuclear._mixObj = function (obj) {
}
};
obj._nuclearSetStyleData=function(){
this.node&&this.node.querySelector('style').setAttribute('data-nuclearId',this._ncInstanceId);
}
obj._nuclearRender = function (item) {
var isFirstRender = false;
@ -181,7 +184,7 @@ Nuclear._mixObj = function (obj) {
this._nuclearFix();
if (this.onRefresh) this.onRefresh();
}
this._nuclearSetStyleData();
//刷新局部样式
if (!isFirstRender) {
Nuclear.refreshStyle(this._ncInstanceId);