Skip to content

Commit

Permalink
fix grid bug: #60 & #66
Browse files Browse the repository at this point in the history
  • Loading branch information
furybean committed Aug 5, 2016
1 parent 9a5c767 commit 0ec7fd2
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue-desktop",
"version": "0.2.29",
"version": "0.2.30",
"description": "A UI library for building admin panel website.",
"main": "lib/index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/data/grid-column.vue
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
let columnConfig = this.columnConfig;
if (type === 'selection') {
headerTemplate = '<input type="checkbox" @click="$parent.toggleAllSelection($event)" />';
headerTemplate = '<input type="checkbox" v-model="$parent.isAllSelected" :false-value="false" @click="$parent.toggleAllSelection($event)" />';
template = '<input type="checkbox" @change="$parent.$parent.toggleSelection($event, row)" v-model="row.$selected"/>';
if (!width) {
columnConfig.minWidth = columnConfig.width = columnConfig.realWidth = 30;
Expand Down
8 changes: 8 additions & 0 deletions src/data/grid.vue
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,14 @@
},
computed: {
isAllSelected() {
var data = this.data || [];
if (data.length === 0) return false;
return data.filter(function(item) {
return item.$selected !== true;
}).length === 0;
},
selection() {
if (this.selectionMode === 'multiple') {
var data = this.data || [];
Expand Down
6 changes: 5 additions & 1 deletion src/nav/tabs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
var getStyle = require('wind-dom').getStyle;
var domUtil = require('wind-dom');
import { throttle } from '../util';
var Vue = require('vue');
export default {
props: {
Expand All @@ -44,7 +45,10 @@
},
watch: {
activeTabIndex(newVal) {
activeTab(newVal) {
Vue.nextTick(() => {
this.$broadcast('onresize');
});
},
tabs() {
this.$nextTick(() => {
Expand Down

0 comments on commit 0ec7fd2

Please sign in to comment.