Skip to content

Commit

Permalink
fix: <issue about uku-repeat not works in <th> tag>
Browse files Browse the repository at this point in the history
momoko8443 committed Feb 26, 2018
1 parent 084b417 commit d125b3b
Showing 4 changed files with 22 additions and 7 deletions.
18 changes: 16 additions & 2 deletions demo/components/comp3.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
<uku-component>
<template>
<div>
<h3 uku-text="cc.user.username"></h3>
<!-- <h3 uku-text="cc.user.username"></h3>
<ul>
<li uku-repeat="option in cc.options">{{option.name}}</li>
</ul>
<h3 uku-text="cc.getFuncLabel(cc.name)"></h3>
<h3 uku-text="cc.getFuncLabel(cc.name)"></h3> -->
<table class="table table-hover">
<thead>
<tr>
<th uku-repeat="user in cc.users">{{user.name}}</th>
</tr>
</thead>
<tbody>
<tr>
<td>Otto</td>
<td>@mdo</td>
</tr>
</tbody>
</table>
</div>
</template>
<script>
@@ -18,6 +31,7 @@ <h3 uku-text="cc.getFuncLabel(cc.name)"></h3>
return _name + "aaa";
}
this.name = "xiao hong";
this.users = [{"name":"momoko"},{"name":"sakura"}];
Object.defineProperty(this, "opts", {
set: function (value) {
if(value){
2 changes: 1 addition & 1 deletion dist/uku.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/uku.js.map

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions src/model/BoundItemRepeat.ts
Original file line number Diff line number Diff line change
@@ -58,10 +58,11 @@ export class BoundItemRepeat extends BoundItemBase{

function generateTempContainer():HTMLElement{
let index = UkuleleUtil.searchHtmlTag(self.renderTemplate,"tr");
if(index === -1){
return document.createElement("div");
}else{
let index2 = UkuleleUtil.searchHtmlTag(self.renderTemplate,"th");
if(index === -1 || index2 === -1 ){
return document.createElement("tbody");
}else{
return document.createElement("div");
}
}

0 comments on commit d125b3b

Please sign in to comment.