...
 
Commits (9)
    https://gitcode.net/view-design/ViewUI/-/commit/1582a8b1c692737fb0a7f9fa68cfee5671634a3f Checkbox value support null 2021-09-15T16:42:07+08:00 梁灏 admin@aresn.com https://gitcode.net/view-design/ViewUI/-/commit/7cfd6df3f712195f38829d15c2a79910bd0157c6 typo 2021-09-15T16:46:50+08:00 梁灏 admin@aresn.com https://gitcode.net/view-design/ViewUI/-/commit/eb3e1619f7abedc3f0364d065c0475b247b71a9d Cascader value support null 2021-09-15T16:59:11+08:00 梁灏 admin@aresn.com https://gitcode.net/view-design/ViewUI/-/commit/c9a33a082c29fc1781c143c701c30038d4cb3ef3 Slider support value null 2021-09-15T17:10:38+08:00 梁灏 admin@aresn.com https://gitcode.net/view-design/ViewUI/-/commit/c191f1473790814f80899a21bf272f80012317b9 ColorPicker support value null 2021-09-15T17:15:36+08:00 梁灏 admin@aresn.com https://gitcode.net/view-design/ViewUI/-/commit/1bc98659601eb7be802fe2b874d29d8c9b097b50 Rate support value null 2021-09-15T17:19:26+08:00 梁灏 admin@aresn.com https://gitcode.net/view-design/ViewUI/-/commit/6ebd9456f0b86565faf9b00682d9e05133823d65 publish 4.7.0-beta.5 2021-09-15T17:26:31+08:00 梁灏 admin@aresn.com https://gitcode.net/view-design/ViewUI/-/commit/0ddc59a168507568cadc471682c774a19b410803 DatePicker, TimePicker support value null 2021-09-15T17:58:03+08:00 梁灏 admin@aresn.com https://gitcode.net/view-design/ViewUI/-/commit/45098aa3b972e941d79394580ddf4c21da266c2d publish 4.7.0-beta.6 2021-09-15T18:00:27+08:00 梁灏 admin@aresn.com
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
{
"name": "view-design",
"version": "4.7.0-beta.4",
"version": "4.7.0-beta.6",
"title": "ViewUI",
"description": "A high quality UI components Library with Vue.js",
"homepage": "http://www.iviewui.com",
......
......@@ -168,7 +168,7 @@
selected: [],
tmpSelected: [],
updatingValue: false, // to fix set value in changeOnSelect type
currentValue: this.value,
currentValue: this.value || [],
query: '',
validDataStr: '',
isLoadedChildren: false // #950
......
......@@ -30,8 +30,8 @@
},
data () {
return {
currentValue: this.value,
childrens: []
currentValue: this.value || [],
children: []
};
},
computed: {
......@@ -49,10 +49,10 @@
},
methods: {
updateModel (update) {
this.childrens = findComponentsDownward(this, 'Checkbox');
if (this.childrens) {
const { value } = this;
this.childrens.forEach(child => {
this.children = findComponentsDownward(this, 'Checkbox');
if (this.children) {
const value = this.value || [];
this.children.forEach(child => {
child.model = value;
if (update) {
......
......@@ -242,8 +242,8 @@ export default {
data() {
return {
val: changeColor(this.value),
currentValue: this.value,
val: changeColor(this.value || ''),
currentValue: this.value || '',
dragging: false,
visible: false,
recommendedColor: [
......@@ -412,7 +412,7 @@ export default {
this.val = changeColor(newVal);
},
visible(val) {
this.val = changeColor(this.value);
this.val = changeColor(this.value || '');
this.$refs.drop[val ? 'update' : 'destroy']();
this.$emit('on-open-change', Boolean(val));
},
......
......@@ -805,11 +805,12 @@
},
},
mounted () {
const initialValue = this.value;
const parsedValue = this.publicVModelValue;
if (typeof initialValue !== typeof parsedValue || JSON.stringify(initialValue) !== JSON.stringify(parsedValue)){
this.$emit('input', this.publicVModelValue); // to update v-model
}
// 下面的判断可能是没必要的,反而会破坏初始的 null 值
// const initialValue = this.value;
// const parsedValue = this.publicVModelValue;
// if (typeof initialValue !== typeof parsedValue || JSON.stringify(initialValue) !== JSON.stringify(parsedValue)){
// this.$emit('input', this.publicVModelValue); // to update v-model
// }
if (this.open !== null) this.visible = this.open;
// to handle focus from confirm buttons
......
......@@ -53,7 +53,7 @@
data () {
return {
currentValue: this.value,
childrens: []
children: []
};
},
computed: {
......@@ -75,9 +75,9 @@
},
methods: {
updateValue () {
this.childrens = findComponentsDownward(this, 'Radio');
if (this.childrens) {
this.childrens.forEach(child => {
this.children = findComponentsDownward(this, 'Radio');
if (this.children) {
this.children.forEach(child => {
child.currentValue = this.currentValue === child.label;
child.group = true;
});
......
......@@ -81,12 +81,13 @@
}
},
data () {
const value = this.value || 0;
return {
prefixCls: prefixCls,
hoverIndex: -1,
isHover: false,
isHalf: this.allowHalf && this.value.toString().indexOf('.') >= 0,
currentValue: this.value
isHalf: this.allowHalf && value.toString().indexOf('.') >= 0,
currentValue: value
};
},
computed: {
......@@ -136,7 +137,7 @@
}
return [
{
{
[`${prefixCls}-star`]: !this.showCharacter,
[`${prefixCls}-star-chart`]: this.showCharacter,
[`${prefixCls}-star-full`]: (!isLast && full) || (isLast && !this.isHalf),
......
......@@ -181,7 +181,8 @@
}
},
data () {
const val = this.checkLimits(Array.isArray(this.value) ? this.value : [this.value]);
let val = this.checkLimits(Array.isArray(this.value) ? this.value : [this.value]);
if (this.range && this.value === null) val = [0, 0];
return {
prefixCls: prefixCls,
currentValue: val,
......
......@@ -193,11 +193,11 @@ export {findComponentUpward};
// Find component downward
export function findComponentDownward (context, componentName) {
const childrens = context.$children;
const $children = context.$children;
let children = null;
if (childrens.length) {
for (const child of childrens) {
if ($children.length) {
for (const child of $children) {
const name = child.$options.name;
if (name === componentName) {
children = child;
......